adb 个人小结
一、通过adb查询当前正在运行的App程序
adb shell dumpsys window | findstr mCurrentFocus
二、多个仿真机链接情况下使用如下命令查询
adb -s simulator dumpsys window | findstr mCurrentFocus
三、通过无线WiFi链接物理机(手机)
3.1、 通过命令开启端口
C:\Users\Microsoft>adb tcpip 5555
restarting in TCP mode port: 5555
如上图,出现"restarting in TCP mode port: 5555"代表开启端口成功
3.2、接着执行adb connect IP地址:5555,这时候应该就能连接成功了
成功提示:connected to IP地址:5555
3.3、通过adb devices 命令查看是否链接成功
List of devices attached
IP地址:5555 devices
四、adb 服务重启命令是
adb kill-server
然在执行adb devices 命令,服务自动重启