adb 使用备忘

167 阅读1分钟

文档: Android 调试桥 (adb)  |  Android 开发者  |  Android Developers

  1. 连接设备

    adb connect ip
    
  2. 查看链接的设备

     adb devices -l
    
  3. 发送命令

    adb [-s diviceName] install helloWorld.apk # 连接多个设备时需要指定设备名字
    
    adb install helloWorld.apk
    
  4. 复制文件

    adb pull remote local  # 从设备复制到本地
    adb push local remote  # 从本地上传到设备 
    
    # 比如 adb push foo.txt /sdcard/foo.txt
    
  5. 发送shell命令

    adb [-d |-e | -s serial_number] shell shell_command  # 连接多个设备时需要指定设备名字
    
    # 如 adb shell ls /system/bin
    
    
  6. 执行交互式shell

    adb [-d | -e | -s serial_number] shell # 连接多个设备时需要指定设备名字
    
    adb shell