Some common operations of adb

1. Connect the device to the computer and open the USB debugging mode of the Android system.

2. Use the terminal under the software Android studio

3. Some common commands:

1. View connected devices: adb devices

2. Connect the device: adb connect + device IP

3. Specify the operation for a certain device (can be used if there is a problem of exceeding the number of running devices): adb -s IP:5555 + command

4. Install the generated apk file into the system through the adb command:

 5.adb -s IP:5555 install path\app.apk

6. Kill the adb service: adb kill-server (if adb kill-server does not work, try taskkill /f /im adb.exe)

7. Enter the command line: adb shell

8. Use adb to transfer files to the Android system: adb push file directory\config.ini /data

If an error occurs:

adb: error: failed to copy 'D:\AndroidStudioProjects\config.ini' to '/data/user/config.ini': remote couldn't create file: Permission denied

Solution: Apply for permission first, then reload the file system

The Android system must first enter developer mode, turn on USB debugging, turn on ROOT's adb authorization, and then use the following command on the command line

adb root

adb remount

Then execute the push command

 9. Download Android files to a local directory: adb pull  <remote> <local>

Guess you like

Origin blog.csdn.net/2301_77318278/article/details/131262436