1.查看当前连接设备
adb devices
2.安装apk
adb install -r app.apk
adb push app.apk 路径
3.获取文件
adb pull 文件路径 存储位置
4.查看log
adb shell
logcat | grep “TAG”
5.重新挂载分区
adb remount
6.删除apk
adb remount
adb shell
cd apk路径
rm app.apk
7.删除AS直接编译的apk
adb remount
adb shell
cd data/app
rm *.apk
8.启动app/activity
adb shell am start -n 包名/类名
9.关闭Activity
adb shell am force-stop 包名
10.发送广播
adb shell am broadcast -a “action”
11.启动service
adb shell am startservice -n 包名/类名 -a action
12.查看全部进程
adb shell ps
ps -A
13.查看指定包名进程
adb shell ps | grep “包名”
14.杀死指定进程
adb shell kill [pid]
15.模拟按键
adb shell input keyevent 3
16.录制屏幕
adb shell screenrecord /sdcard/*.mp4
网友评论