查看安裝包信息aapt list apk路徑
* aapt list xxx/app-debug.apk
查看apk文件信息並保存到本地(> 重定向符)
* aapt list xx/app-debug.apk > /Users/user/Desktop/apk.txt
查看apk權限aapt dump (code) apk路徑
* aapt dump permissions /Users/jalon/Downloads/huai/app/build/outputs/apk/debug/app-debug.apk
code說明:
* strings Print the contents of the resource table string pool in the APK.
badging Print the label and icon for the app declared in APK.
permissions Print the permissions from the APK.
resources Print the resource table from the APK.
configurations Print the configurations in the APK.
xmltree Print the compiled xmls in the given assets.
xmlstrings Print the strings of the given compiled xml assets.
adbshell
安裝apk包到手機 adb install -r apk路徑
* adb install -r xxx/app-debug.apk
安裝包複製到手機 adb push apk路徑 手機路徑
* adb push xxx/debug/app-debug.apk /sdcard
保存到本地 (adb pull 手機文件 pc路徑)
* adb pull sdcard/screenshot.png /Users/user/Desktop/file
刪除文件
查看系統盤符
* adb shell df
打印Log( | grep + 篩選條件)
* adb shell
* logcat | grep "custominfo"
在終端中只打印TAG = xyz的日誌
* adb logcat -s xyz
日誌保存到手機
* adb logcat -f sdcard/log.txt
查看已安裝的應用
* adb shell pm list package -f | grep "qq"
截屏
* adb shell screencap -p /sdcard/screenshot.png
模擬按鍵輸入(3:home)
* adb shell input keyevent 3
模擬滑動輸入(x1 y1 x2 y2)* adb shell input touchscreen swipe 18 999 18 666