Android WIFI无线链接并调试设备方法

来源:互联网 发布:虎扑推荐aj淘宝店铺 编辑:程序博客网 时间:2024/05/19 20:49

ADB命令通过WIFI链接设备步骤:

电脑链接多个设备时,给指定的设备安装apk

USB调试:

$adb devices //查看列表设备ID(serial no)

$adb -s  [serial no] install [apkFile]

$ adb -s 021WNP4C2B012236 uninstall com.polysaas.mdm
Success

adb 到指定的设备shell

$ adb -s 021WNP4C2B012236 shell
shell@android:/ $


链接设备:

1:Root

前提设备需root

adb devices 会显示该手机的ip 

eg:10.1.6.10:5555 (5555是设备的默认端口)

网上下载个客户端(移动端模拟器)用来监听设备的

输入以下命令:

su //获取root权限

#setprop service.adb.tcp.port 5555 

#stop adbd

#start adbd

电脑打开dos

#adb connect  10.1.6.10:5555 //10.1.6.10 为设备的ip 

2:不需要Root

1确保设备与PC在同一WIFI网络环境

2USB链接到PC

$ adb devices
List of devices attached
aab096f4 device

$ adb usb
restarting in USB mode

3用adb tcpip重启adb

$ adb tcpip 5555
restarting in TCP mode port: 5555

4查看设备IP

$ adb shell ifconfig wlan0
wlan0: ip 10.1.6.116 mask 255.255.255.0 flags [up broadcast running multicast]

5

$ adb connect 10.1.6.116:5555
connected to 10.1.6.116:5555

拔掉USB线,你会发现设备仍然是连接上的,如果没有连接上,用刚才的命令重现尝试一下。

$ adb shell
shell@klte:/ $

0 0
原创粉丝点击