ADB常用命令

Posted 5念since

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ADB常用命令相关的知识,希望对你有一定的参考价值。

ADB Debugging

  • List of devices attached
adb devices
  • List connected devices (-l for long output)
adb devices -l

Wireless

  • adb connect

STEP 1.
Set the target device to listen for a TCP/IP connection on port 5555
disconnect the USB cable from the android device

adb tcpip 5555

STEP 2.

Connect to a device over Wi-Fi.

find your Android device IP address at Settings > About phone > Status > IP address

adb connect 192.168.100.12

STEP 3.

Confirm that your host computer is connected to the Android device over Wi-Fi


adb devices

Package Manager

  • app installation - push a single package to the device and install it
adb install test.apk

File Manager

  • adb pull

copy files/dirs from device
To copy a file or directory and its sub-directories from the Android device

adb  pull /mnt/sdcard/Download/test.apk pc.apk

preserve file timestamp and mode.

adb  pull -a /mnt/sdcard/Download/test.apk pc.apk
  • adb push
    copy local files/directories to Android device
adb push pc.apk /mnt/sdcard/Download/test.apk

only push files that are newer on the host than the Android device

adb push --sync pc.apk /mnt/sdcard/Download/test.apk

ADB

以上是关于ADB常用命令的主要内容,如果未能解决你的问题,请参考以下文章

常用的adb命令

adb测试常用命令

超实用的adb与adb shell常用命令汇总

ADB常用命令

Android 常用adb命令

adb shell monkey常用命令