adb常用命令

182 阅读1分钟

查看adb版本号


adb --version

重启adb


adb kill server

adb start server

查看当前adb连接的设备


adb devices

安装文件到手机


adb install <file>

根据包名卸载


adb uninstall <pkg-name>

存在多个设备时,直接install会出错,需要制定设备名称。


adb -s <device-name> install <file>

device-name怎么来的呢?就是adb devices中列出的设备名称。

覆盖安装


adb install -r <file>

按组列出权限和状态:


adb shell pm list permissions -d -g

授予或撤消一项或多项权限:


adb shell pm [grant|revoke] <permission-name> ...