aapt&adb笔记

aapt

查看安装包信息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.

adb

 安装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

 删除文件
  1. adb remount
  2. adb shell
  3. cd sdcard
  4. remove *.apk(remove 文件名)
 查看系统盘符
* 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




原文地址:https://www.cnblogs.com/cnman/p/10624586.html