```
adb shell pm list packages #得到手机中已经安装的app的包名
adb shell pm path phone.android # 得到app在手机中安装的具体路径,phone.android是包名
adb pull /data/app/XXX.apk c:\ #把手机中的app拉倒本地
aapt dump badging c:\XXX.apk #解析apk的信息,包括包名和主acitivity
adb shell input keyevent 26 唤醒屏幕
adb logcat -d > c:/b.log
adb install XXX.apk
adb devices 查看在线的设备
adb logcat | grep MyApp 查看日志
adb reboot recovery
```
截图命令
```
adb shell /system/bin/screencap -p /sdcard/screenshot.png
```
将截图复制到电脑盘中
```
adb pull /sdcard/screenshot.png E:\download
```
## windows bat自动安装apk命名
* 使用方法直接拖app到bat文件即可
```
@ECHO OFF
ECHO [安装APK,需要配置好Android sdk环境]
ECHO -------------------------------
ECHO [等待插入手机...]
adb wait-for-device
ECHO [安装] %~nx1
adb install -r %1
ECHO [暂停3秒自动关闭...]
ping -n 3 127.0.0.1>nul
```
## 查看apk的基本信息
```
@ECHO OFF
ECHO [查看APK包信息]
ECHO -------------------------------
ECHO aapt dump badging %~nx1
aapt dump badging %1 > %~dp0%~n1.txt
ECHO [暂停3秒自动关闭...]
ping -n 3 127.0.0.1>nul
@ECHO ON
```