# ADB 常用指令
adb shell getprop ro.build.version.release # 获取系统版本 | |
adb shell getprop ro.build.version.sdk # 获取系统 api 版本 | |
adb shell dumpsys window | findstr mCurrentFocus # 获取 apk 包名和当前进程名,或者后面 findstr FocusedWindow | |
adb shell getprop ro.product.cpu.abi # 查询手机信息(32 位 / 64 位) | |
adb shell pm list package # 查看手机安装的软件包名 | |
adb forward tcp:27042 tcp:27042 # 设置代理转发 | |
adb push test.txt /sdcard/Download # 将电脑当前目录的的 test.txt 文件 推送到手机的 download 目录 | |
adb pull /sdcard/Download/test.txt # 将手机端 download 目录下的 test.txt 文件 下拉到电脑当前目录 | |
adb shell pm path "com.tencent.mm" # 获取包名为 com.tencent.mm 的软件在手机端的安装包 | |
adb devices # 查看当前 pc 端连接有多少设备 | |
adb get-serialno # 获取设备的 ID 和序列号 serialNumber | |
adb reboot # 重启设备 | |
adb reboot bootloader # 重启到 bootloader,即引导模式 | |
adb reboot recovery # 重启到 recovery,即恢复模式 | |
adb shell pm uninstall -k --user 0 软件包名 # 卸载预装软件 | |
adb shell am monitor # 监控手机打开的 app 包名 | |
adb install --abi armeabi-v7a pkgname # 指定 v7a 架构安装,即 32 位 | |
adb shell input keyevent 26 # 熄屏 / 亮屏 | |
adb shell input swipe 500 2000 500 1000 # 滑动 | |
adb shell dumpsys power | grep "Display Power" # 是否亮屏 | |
adb shell dumpsys window | grep screenState # 是否亮屏 |
# Fastboot 常用指令
fastboot flash boot boot.img # 刷入 boot 分区 | |
fastboot flash system system.img # 刷入 system 分区 | |
fastboot flash recovery recovery.img # 刷入 recovery 分区 | |
fastboot erase frp # 即 **Factory Reset Protection**, 用于防止用户信息在手机丢失后外泄 | |
fastboot flashing lock # 给设备上 bl 锁 | |
fastboot oem device-info # 检查是否解锁成功 | |
fastboot getvar current-slot # 这将显示你当前使用的哪个插槽(A/B 分区) |