您的位置:首页 > 其它

ADB常用命令

2018-01-17 12:21 393 查看
安装:

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: