配置 PATH
adb 命令在哪?默认情况下,adb命令所在目录并没有配置到 PATH 路径里,通常在 platform-tools 目录里,为了方便使用 adb 命令可以将这个目录添加到 PATH: ~/Library/Android/sdk/platform-tools。
常用命令介绍
当通过 abd devices 找不到设备时,可以通过 connect 主动连下
1
2
| adb connect 10.7.40.149
connected to 10.7.40.149:5555
|
1
2
3
| adb devices
List of devices attached
10.7.40.149:5555 device
|
1
2
| adb disconnect 10.7.40.149
disconnected 10.7.40.149
|
1
| adb -s 10.7.40.149:5555 shell
|
1
| adb -s 10.7.40.149:5555 logcat
|
1
| adb -s 10.7.40.149:5555 install xx.apk
|
1
| adb -s 10.7.40.149:5555 uninstall com.your.package
|
1
2
3
| adb -s J7856P6H55LBSG9X shell
OP5287:/ $ dumpsys window | grep mCurrentFocus
mCurrentFocus=Window{e3d680d u0 tv.danmaku.ijk.media.example/tv.danmaku.ijk.media.example.activities.FileExplorerActivity}
|