ADB常用命令

  • 安装:
adb -s f0decf5c install c:/Users/admin/Desktop/my_application.apk
  • 重新安装
adb -s f0decf5c install -r packages_location
  • 卸载
adb -s f0decf5c uninstall packages_name
  • 将电脑上的文件推送到手机
adb -s f0decf5c push c:/Users/admin/Desktop/my_application.apk /tmp
  • 将手机中的文件下载到电脑
adb -s f0decf5c pull /tmp/1.txt c:/users
  • 常用的adb shell命令

    • 按键命令

      adb -s f0decf5c shell input text <string>   # 输入文本
      adb -s f0decf5c shell keyevent <event_code> # 按键
    • am命令

      adb -s f0decf5c shell am start <intent> # start Activity。
      如 am start -n com.android.calculator/com.android.calculator2.Calculator
      adb -s f0decf5c  shell am broadcast <intent>
      adb -s f0decf5c  shell am startservice <intent>
      adb -s f0decf5c  shell am force-stop <intent>
      adb -s f0decf5c  shell am kill <package>
      adb -s f0decf5c  shell am kill-all
    • pm命令

      adb -s f0decf5c shell pm list packages -f # 列出包
      adb -s f0decf5c shell pm list permissions -f # 列出权限
      adb -s f0decf5c shell pm list packages # 列出包
  • 查看安装的包

adb -s f0decf5c shell pm list packages | findstr "sogou"
  • dumpsys使用
adb -s f0decf5c shell service list      # 查看运行的系统服务
adb -s f0decf5c shell dumpsys + service_name    # 查看指定的service信息
adb -s f0decf5c shell dumpsys acitivity
adb -s f0decf5c shell dumpsys cpuinfo
adb -s f0decf5c shell dumpsys battery
adb -s f0decf5c shell dumpsys window
adb -s f0decf5c shell dumpsys package
adb -s f0decf5c shell dumpsys activity | grep mFocusedActivity  # 查看当前activity
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值