手机版

ADB 常用命令合集(2)

时间:2025-07-07   来源:未知    
字号:

做为主机向模拟器或设备的请求端口。如:adb forward tcp:5555 tcp:8000

adb reboot 重启手机-----常用

adb remount 将system分区重新挂载为可读写分区-----常用

adb kill-server 终止adb服务进程-----常用

adb start-server 重启adb服务进程

adb root 已root权限重启adb服务

adb wait-for-device 在模拟器/设备连接之前把命令转载在adb的命令器中 adbjdwp 查看指定的设施的可用的JDWP信息.

可以用 forward jdwp:<pid> 端口映射信息来连接指定的JDWP进程.例如: adb forward tcp:8000 jdwp:472

jdb -attach localhost:8000

adb shell am 命令可以启动应用程序

adb shell input text <string>向设备输入文本(光标所在的文本框) adb shell input keyevent<event_code>向设备发送按键事件

如:

在编辑短信时,往文本框输入文本:adb shell input text "hello" 向手机发送键值回Home:adb shell input keyevent 3

event_code 参考view/KeyEvent.java中的 KEYCODE_*

public static final int KEYCODE_SOFT_LEFT = 1;

public static final int KEYCODE_SOFT_RIGHT = 2;

public static final int KEYCODE_HOME = 3;

public static final int KEYCODE_BACK = 4;

public static final int KEYCODE_CALL = 5;

public static final int KEYCODE_ENDCALL = 6;

-----------安装卸载 系列----------- -----常用

adb install [-l] [-r] <file> - push this package file to the device and install it

('-l' means forward-lock the app)

('-r' means reinstall the app, keeping its data)

adb uninstall [-k] <package> - remove this app package from the device ('-k' means keep the data and cache directories)

ADB 常用命令合集(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)