By Long Luo
ADB工具是Android开发中使用很频繁也是非常重要的一个工具,用于手机与电脑的通信。
Help
1 | E:\Tools>adb shell pm help |
获取安装包
1 | E:\Tools>adb shell pm list packages -s |
查找其安装位置:
1 | E:\Tools>adb shell pm list packages -f | grep "tencent" |
无线调试
https://developer.android.com/studio/command-line/adb.html
获取设备IP
通过TCP端口连接
1 | adb connect |
断开连接
1 | adb disconnect |
截图与录屏
1 | adb shell screencap -p /sdcard/screenshot.png |
1 | adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screenshot.png |
帧率分析
1 | adb shell dumpsys gfxinfo 包名 |
1 | E:\Tools>adb shell dumpsys gfxinfo com.tencent.mobileqq > fps.txt |
dumpsys
- Activity
- cpuinfo
- meminfo
- package
- window
- statusbar
- battery/batteryinfo
- alarm
Logcat
help
1 | E:\Tools>adb logcat --help |
第三方Logcat
https://github.com/JakeWharton/pidcat