adb常用操作

1.安装程序

  adb -s serialno install -r path

2.切换电源

  adb -s serialno shell input keyevent 26

3.主页键

  adb -s serialno shell input keyevent 3

4.回退键

  adb -s serialno shell input keyevent 67

5.菜单键

  adb -s serialno shell input keyevent 82

6.重启手机

  adb -s serialno reboot

7.等待手机连接

  adb -s serialno wait-for-device

8.得到设备状态

  adb -s serialno get-state

9.移除所有端口映射

  adb  forward --remove-all

10.端口映射

  adb forward tcp:localport tcp:remoteport

11.开启appservice

  adb -s serialno shell am startservice -n com.keye/com.keye.service -a com.keye.ACTION_START

原文地址:https://www.cnblogs.com/asminfo/p/6060640.html