我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
我认为有一种方法可以通过Wi-Fi测试开发中的应用程序。这可能吗?
我希望能够解开我的手机,无线开发。
当前回答
对于Ubuntu / Linux:
Make sure your device is working for debugging: http://developer.android.com/tools/help/adb.html#Enabling Go to your sdk folder and find the folder platform-tools Use ./adb devices to list the connected devices. Make sure it is only one device connected and no emulator running. Find your device IP address, you can find it in your device: http://developer.android.com/tools/help/adb.html#wireless, or got adb shell like this: ./adb shell then netcfg. You will see a list of IP addresses. Find wlan0, in my case 192.168.100.3/2. ./adb tcpip 5555 Finally enter ./adb connect <Your device IP Address>:5555 in your terminal. You can now deploy the application to your device over Wi-Fi.
其他回答
最好的方法是使用ADBConnect (Eclipse插件)和ADB Wireless (Android设备应用程序)。
Windows:
步骤1。使用下面的命令创建一个批处理文件,并将该文件称为w.bat。
步骤2。将下面的内容复制到w.b bat中,并保存在Windows系统%path%中的任意文件夹中
echo ***Get phone in Wi-Fi mode***
echo ***Get phone in Wi-Fi mode***
adb devices
echo ***Remove cable from the phone now***
adb tcpip 9000
adb connect 192.168.1.1:9000
adb connect 192.168.1.2:9000
adb connect 192.168.1.3:9000
adb connect 192.168.1.4:9000
adb connect 192.168.1.5:9000
adb connect 192.168.1.6:9000
<--到这里-->
步骤3。用数据线连接你的手机和电脑
步骤4。确保手机处于Wi-Fi模式
第5步。当批处理文件要求您移除电缆时
步骤6。在Windows提示符上输入w.bat (start -> run -> Type CMD,按Enter)(黑屏是Windows DOS提示符),如果你在其中一个路径文件夹中复制了它,那么你可以从任何地方运行,否则从你创建这个文件的文件夹运行。
批处理文件的输出如下所示:
C:\Windows\System32>w
C:\Windows\System32>echo ***Get phone in Wi-Fi mode***
***Get phone in Wi-Fi mode***
C:\Windows\System32>echo ***Get phone in Wi-Fi mode***
***Get phone in Wi-Fi mode***
C:\Windows\System32>adb devices
List of devices attached
d4e9f06 device
C:\Windows\System32>echo ***Remove cable from the Phone now***
***Remove cable from the Phone now***
C:\Windows\System32>adb tcpip 9000
restarting in TCP mode port: 9000
C:\Windows\System32>adb connect 192.168.1.1:9000
unable to connect to 192.168.1.1:9000:9000
C:\Windows\System32>adb connect 192.168.1.2:9000
connected to 192.168.1.2:9000
C:\Windows\System32>adb connect 192.168.1.3:9000
unable to connect to 192.168.1.3:9000:9000
C:\Windows\System32>adb connect 192.168.1.4:9000
unable to connect to 192.168.1.4:9000:9000
C:\Windows\System32>adb connect 192.168.1.5:9000
unable to connect to 192.168.1.5:9000:9000
C:\Windows\System32>adb connect 192.168.1.6:9000
unable to connect to 192.168.1.6:9000:9000
注1:在输出中找到这个,(忽略所有->unable to connect<- errors)
connected to xxx.xxx.x.x:9000
如果你在结果中看到这个,只需从PC上移除电缆,进入Eclipse并运行在设备上安装应用程序;应该是这样。
注意2:断开或切换无线模式关闭:键入下面的命令。它应该说在USB模式下重新启动-在这个阶段PC和计算机不应该用电缆连接:
C:\Users\dell>adb usb
restarting in USB mode
注3:查找话机IP地址的步骤(取自Stack Overflow)
查找MY PHONE的IP地址:
a. Dial *#*#4636#*#* to open the Testing menu.
b. In the Wi-Fi information menu: click Wi-Fi Status
c. Wi-Fi status can be blank for the first time
d. Click Refresh Status
e. In the IPaddr: <<IP ADDRESS OF THE PHONE IS LISTED>>
注4:我的手机Wi-Fi连接IP地址范围一般为下面提到的IP地址,
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
192.168.1.6
注意5:如果你得到的IP地址序列不断被重新分配给你的手机,你可以在w.b bat文件中修改IP地址。
注意6:这是一种强制方法,它消除了寻找IP地址和连接到Eclipse / Wi-Fi的所有手工劳动。
所以简而言之,常规的活动应该是这样的:
Step 1. Connect PC and Wi-Fi via a cable
Step 2. Start CMD - to go to Windows DOS prompt
Step 3. Type "w"
Step 4. Find connected command in the output
Step 5. Success, remove cable and start using Eclipse
我使用adb shell ip -f inet addr show wlan0来查找adb tcpip 5555之后的设备ip。
新版本已弃用adb netcfg。因此,当接口名称为wlan0(默认接口名称)时,这是查找设备ip的正确方法。
>## open command prompt with Run as Administrtor ##
adb connect ipdevice:5037
如果你想在设备上启用无线adb,而不需要连接USB线(root要求):
在设备上安装终端应用程序(如Android终端模拟器) 输入以下内容 苏 Setprop service.adb.tcp.port 5555 停止adbd 开始adbd
因为你已经打开了终端,你可以找到设备的IP地址:
ip addr show
然后在调试环境中运行命令:
adb connect ip.of.the.device
这将使该设备被列为您可能拥有的任何其他模拟器。请注意,在重置设备之前,TCP将保持打开状态。 如果你经常断网,你可能还想安装一个Wi-Fi Keep Alive应用程序。
如果你想要安全,记得在连接到公共网络时关闭TCP。您可以执行以下操作或简单地重新启动设备:
苏 Setprop service.adb.tcp.port -1 停止adbd 开始adbd