安裝一個apk
adb root
adb remount
adb -s device_id install -r your.apk
啟動一個apk
- 找到應(yīng)用的包名:
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
關(guān)閉selinux
getenforce
set enforce 0
開啟Wifi ADB
adb tcpip <port_number>
adb shell ifconfig wlan0 查看ip
adb connect <ip:port_number>
adb disconnect
查看系統(tǒng)信息
adb shell cat /system/build.prop
查看全部進(jìn)程
ps -A
查看某個程序的信息
adb shell dumpsys meminfo <package_name>/<pid>
查看當(dāng)前前臺進(jìn)程
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 查看當(dāng)前分辨率
screecap 1280x720 /path/xx.mp4
得到系統(tǒng)中運(yùn)行的服務(wù)
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