我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
当前回答
(不需要根)有一个最好的,简单的和Android Studio的UI方法
IntelliJ和Android Studio插件创建快速连接您的Android设备通过WiFi安装,运行和调试您的应用程序没有USB连接。按下一个按钮,就不用管USB线了。
只需安装插件Android WiFi ADB
直接下载安装Android WiFi ADB
Intellij / Android Studio:首选项/设置->插件->浏览库
.
记住!第一次初始化设备,您必须使用usb连接
或者,您也可以从JetBrains插件站点下载插件并手动安装:Preferences/Settings->Plugins->从磁盘安装插件。
您可以轻松连接和管理您的设备.......更多信息请阅读这里https://github.com/pedrovgs/AndroidWiFiADB
其他回答
first you shold connect your device with usb to pc after that run cmd and drag and drop adb.exe that is in sdk/platform-tools path and write below code :
....\Sdk\platform-tools\adb.exe devices
.....\Sdk\platform-tools\adb.exe tcpip 5555
.....\Sdk\platform-tools\adb.exe connect Ip address:5555
adb实用程序能够通过TCP/IP连接到设备。但是,adbd通常不会监听TCP连接。
如果您想让它运行,您需要一个工程设备(换句话说,您需要root)。然后按照这篇文章中的指导去做:
如何通过TCP连接到ADB的Android ?
由于这只适用于eng设备,所以它不受官方支持。使用风险自负,包括bug等。
有办法查看Android屏幕远程没有根?- 9号帖子。
通过USB连接设备,并确保调试工作正常; Adb tcpip 5555。这使得设备开始监听端口5555上的连接; 使用adb shell netcfg或adb shell ifconfig(6.0及以上版本)查找设备IP地址; 您现在可以断开USB; adb connect <DEVICE_IP_ADDRESS>:5555。这将连接到我们在步骤2中在设备上设置的服务器; 现在您在网络上有了一个设备,可以像往常一样使用它进行调试。
要将服务器切换回USB模式,请运行adb USB,这将使您手机上的服务器恢复到USB模式。如果您有多个设备,您可以使用-s选项指定设备:adb -s <DEVICE_IP_ADDRESS>:5555 usb。
不需要根!
如果需要查询设备的IP地址,请先执行adb shell命令,再执行netcfg命令。你会在那里看到。 当使用OSX时,可以使用adb shell IP route命令查询IP地址。
警告:启用该选项是危险的,网络中的任何人都可以在调试中连接到您的设备,即使您是在数据网络中。只有连接到可信任的Wi-Fi时才可以这样做,完成后记得断开连接!
@Sergei建议修改第2行,评论道:“当另一个连接持续时(例如,模拟器连接或其他Wi-Fi设备),-d选项需要连接到USB设备”。
这些信息可能对未来的读者很有价值,但我还是回到了得到178个赞的原始版本。
在一些设备上,即使你没有USB线,你也可以做同样的事情:
在开发人员设置中启用网络ADB 它应该显示IP地址 adb connect <DEVICE_IP_ADDRESS>:5555 完成后禁用该设置
使用Android Studio有一个插件,允许您连接USB调试,而不需要从终端使用任何ADB命令。
注意:-安卓手机必须是根,不需要usb线。
在android手机上安装wifi adb
链接:https: / / play.google.com/store/apps/details ? id = com.ttxapps.wifiadb
对于Windows
我用的是这个技巧,非常简单。
1)下载adb:
链接:https://www.dropbox.com/s/mcxw0yy3jvydupd/adb-setup-1.4.3.exe?dl=0
2)运行exe:—当你看到蓝屏时按y enter。
3)现在打开你的wifi adb apk,只需授予root权限,必须记住你的android手机和系统通过wifi或热点在同一个网络上。
4)打开Wifi adb apk,你会得到一些ip地址,比如adb connect 192.168.2.134:5555 注意这个ip可能非常不同于不同的系统,现在把这个信息放到命令提示符中,然后按Enter键。
5)在任意位置打开cmd,输入adb connect 192.168.2.134:5555。
6)最终您成功连接到adb。它会显示像这样的消息 连接到192.168.2.140:5555
对于Mac Os
这是最简单的方法,将提供自动更新。
1)安装自制程序
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2)安装亚行
brew cask install android-platform-tools
3)开始使用adb
adb devices
4)打开Wifi adb apk,你会得到一些ip地址,比如,adb connect 192.168.2.134:5555注意这个ip可能很从系统到系统,现在把这个信息输入到你的终端并按Enter。
5)在mac os中任意打开终端,输入adb connect 192.168.2.134:5555。
6)最终您成功连接到adb。它将显示类似于已连接到192.168.2.140:5555的消息
希望对你有所帮助,谢谢!
更新:
从Android Studio Bumblebee(2021.1.1)稳定版开始,你可以通过扫描二维码对设备进行Wifi调试。
引用博客文章:
通过Wi-Fi的ADB: Bumblebee包括一个简化的连接流程 你的Android 11和更高版本的设备通过Wi-Fi进行部署 使用ADB调试。在你的 的“物理”选项卡中选择“使用Wi-Fi动作的对” 新建设备管理器打开配对向导。然后按照下面的步骤 提供用于与通过同一网络连接的设备配对。学习 更多。
老帖:
有了新的Android 11,你可以在WiFi上调试你的应用程序,而完全不需要使用USB线。
引用自Android Studio用户指南
Connect to a device over Wi-Fi (Android 11+) Android 11 and higher support deploying and debugging your app wirelessly from your workstation using Android Debug Bridge (adb). For example, you can deploy your debuggable app to multiple remote devices without physically connecting your device via USB. This eliminates the need to deal with common USB connection issues, such as driver installation. To use wireless debugging, you need to pair your device to your workstation using a pairing code. Your workstation and device must be connected to the same wireless network. To connect to your device, follow these steps: On your workstation, update to the latest version of the SDK Platform-Tools. On the device, enable developer options. Enable the Wireless debugging option. On the dialog that asks Allow wireless debugging on this network?, click Allow. Select Pair device with pairing code. Take note of the pairing code, IP address, and port number displayed on the device (see image). On your workstation, open a terminal and navigate to android_sdk/platform-tools. Run adb pair ipaddr:port. Use the IP address and port number from step 5. When prompted, enter the pairing code that you received in step 5. A message indicates that your device has been successfully paired. none Enter pairing code: 482924 Successfully paired to 192.168.1.130:37099 [guid=adb-235XY] (For Linux or Microsoft Windows only) Run adb connect ipaddr:port. Use the IP address and port under Wireless debugging.