安装一个apk
adb root
adb remount
adb -s device_id install -r your.apk
启动一个apk
- 找到应用的包名:
adb shell dumpsys package > packages.txt 找到包名 - 启动
adb shell am start -a package/.MainActivity
adb shell am start -n package/.MainActivity - 停止
adb shell am force-stop package/.MainActivity
adb shell pm clear package/.MainActivity
关闭selinux
getenforce
set enforce 0
开启Wifi ADB
adb tcpip <port_number>
adb shell ifconfig wlan0 查看ip
adb connect <ip:port_number>
adb disconnect
查看系统信息
adb shell cat /system/build.prop
查看全部进程
ps -A
查看某个程序的信息
adb shell dumpsys meminfo <package_name>/<pid>
查看当前前台进程
adb shell dumpsys acitvity top
截屏
adb shell screencap -p /storage/1.png
在PowerShell中过滤信息
adb logcat | Select-String "some_regexp"
adb logcat | findstr "some_regexp"
在shell中过滤信息
logcat | gerp -E "some_regexp"
单刷img
adb root
adb remount
adb disable-verity
adb reboot bootloader
fastboot flash system system.img
fastboot reboot
录屏
screen --help 查看当前分辨率
screecap 1280x720 /path/xx.mp4
得到系统中运行的服务
adb shell service list
抓取广播
adb shell dumpsys notification > notification.log
grep过滤
grep -v "word1|word2|word3"
最短行
awk '(NR==1||length(min)>length()){min=$0}END{print min}'
最长行
awk '{if (length(max)<length()) max=$0}END{print max}'
查看文件信息
ls -l
软连接
ln -s old_path linked_path
Disk free
df
显示文件夹大小
du -sh