11.adb常用命令
-
帮助
adb --help -
启动adb server
adb start-server -
关闭adb server
adb kill-server -
获取设备号
a. 设备号就是一个字符串 b. adb devices c. 虚拟机的是:192.168.56.101:5555d.
![获取设备号]()
-
获取系统版本
a. adb -s 设备号 shell getprop ro.build.version.release b. 实际命令即:“adb -s 192.168.56.101:5555 shell getprop ro.build.version.release” -
发送文件到手机
adb push 电脑的文件路径/需要发送的文件 手机存储的路径 -
从手机拉取文件
a. adb pull 手机的路径/文件 发送到电脑的路径b.
![手机与电脑间文件的传输]()
-
查看手机运行日志
adb logcat -
手机shell命令行
a. adb shell b. adb shell ls (会留在电脑而不是Linux) -
获取包名和启动名
a. adb shell dumpsys window windows | findstr mFocusedApp b. com.baidu.searchcraft/.widgets.login.SSLoginGuideActivityc.
![获取包名与启动名]()
-
安装app到手机
a. adb install 路径/xxx.apk b. adb install f:\simple.apkc.
![安装APP]()
-
卸载app
a. adb uninstall 包名 b. adb uninstall com.baidu.searchcraft -
获取app启动时间
a. adb shell am start -W 包名/启动名 b. adb shell am start -W com.baidu.searchcraft/.widgets.login.SSLoginGuideActivity c. ThisTime 启动耗时 d. TotalTime 应用自身启动耗时 = ThisTime + 应用等资源启动时间 e. WaitTime 系统启动应用耗时 = TotalTime + 系统资源启动时间f.
![APP启动时间]()






浙公网安备 33010602011771号