2016-09-07 20:30:46 +01:00
|
|
|
# adb
|
2016-01-06 14:18:54 +08:00
|
|
|
|
2016-09-07 20:30:46 +01:00
|
|
|
> Android Debug Bridge: communicate with an Android emulator instance or connected Android devices.
|
2024-10-04 21:14:41 +02:00
|
|
|
> Some subcommands such as `shell` have their own usage documentation.
|
2024-02-16 12:37:37 -03:00
|
|
|
> More information: <https://developer.android.com/tools/adb>.
|
2016-01-06 14:18:54 +08:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Check whether the adb server process is running and start it:
|
2016-01-06 14:18:54 +08:00
|
|
|
|
|
|
|
`adb start-server`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Terminate the adb server process:
|
2016-01-06 14:18:54 +08:00
|
|
|
|
|
|
|
`adb kill-server`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Start a remote shell in the target emulator/device instance:
|
2016-01-06 14:18:54 +08:00
|
|
|
|
|
|
|
`adb shell`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Push an Android application to an emulator/device:
|
2016-01-06 14:18:54 +08:00
|
|
|
|
2016-07-13 14:23:22 +05:30
|
|
|
`adb install -r {{path/to/file.apk}}`
|
2016-11-26 17:03:36 +01:00
|
|
|
|
2019-02-11 19:00:49 +01:00
|
|
|
- Copy a file/directory from the target device:
|
2016-11-26 17:03:36 +01:00
|
|
|
|
2019-02-11 19:00:49 +01:00
|
|
|
`adb pull {{path/to/device_file_or_directory}} {{path/to/local_destination_directory}}`
|
2016-11-26 17:03:36 +01:00
|
|
|
|
2019-02-11 19:00:49 +01:00
|
|
|
- Copy a file/directory to the target device:
|
2016-11-26 17:03:36 +01:00
|
|
|
|
2019-02-11 19:00:49 +01:00
|
|
|
`adb push {{path/to/local_file_or_directory}} {{path/to/device_destination_directory}}`
|
2016-11-26 17:03:36 +01:00
|
|
|
|
2024-01-31 00:55:19 -03:00
|
|
|
- List all connected devices:
|
2016-11-26 17:03:36 +01:00
|
|
|
|
|
|
|
`adb devices`
|