常用adb 命令(Android 开发必备)

454 阅读1分钟
  • adb shell monkey -v -p com.sp.helper -s 100 --pct-touch 100 100 对指定包名发送随机事件 (monkey测试)
  • adb shell pm clear com.sp.helper
  • adb install -r 覆盖安装,保留数据和缓存文件 -d 解决低版本version问题 -s 安装apk到sd卡
  • adb uninstall 卸载指定包名app
  • adb reboot 重启手机
  • adb kill-server / start-server adb服务重启
  • adb shell 登陆进入安卓系统
  • adb devices 列出设备列表
  • abd -s 模拟器编号 命令
  • adb shell am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-ccategory,-e 扩展数据,等)。
  • adb shell am start com.sp.helper 启动这个应用
  • adb shell am start com.sp.helper/com.sp.helper.MainActivity 启动这个应用的指定activity类
  • adb push 要推到系统的文件路径(直接拖进来) 系统path
  • adb shell input keyevent 26 点亮屏幕
  • adb logcat -s TAG_NAME 日志过滤
  • adb shell dumpsys window | findstr mCurrentFocus 查看当前的activity
  • adb shell pm path 显示安装包路径