|
|
|
## Useful flags
|
|
|
|
1. `adb -e` Sends the command to the emulated device. [^1] (only for when there is just one emulated device.)
|
|
|
|
- `adb -d` Sends the command to the USB device. (only for when there is just one USB device)
|
|
|
|
2. `adb -s [code number]` Sends the command to the specified device.
|
|
|
|
```
|
|
|
|
$ adb devices
|
|
|
|
List of devices attached
|
|
|
|
emulator-5554 device
|
|
|
|
$ adb -s emulator-5554 shell
|
|
|
|
root@generic:/ #
|
|
|
|
```
|
|
|
|
|
|
|
|
## Utility Commands
|
|
|
|
1. `adb shell` Starts a shell on the device.
|
|
|
|
2. `adb pull /path/to/file` Retrieves the file from the specified device and places it on the host.
|
|
|
|
3. `adb push /path/to/source /path/to/destination` Places a copy of the source file and places it at the destination on the device.
|
|
|
|
4. `adb install /path/to/apk` Attempts to install an apk on the specified device.
|
|
|
|
|
|
|
|
## Informative Commands
|
|
|
|
1. `adb devices` Lists the available devices to the host.
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
*See https://developer.android.com/studio/command-line/adb for more information*
|
|
|
|
[^1]: https://stackoverflow.com/questions/14654718/ |
|
|
|
\ No newline at end of file |