2020-08-30 20:20:36 -03:00
|
|
|
# adb shell
|
|
|
|
|
2024-10-08 19:18:11 +03:00
|
|
|
> Run shell commands on a connected Android device or emulator.
|
2024-02-16 12:37:37 -03:00
|
|
|
> More information: <https://developer.android.com/tools/adb>.
|
2020-08-30 20:20:36 -03:00
|
|
|
|
2023-02-19 08:39:26 -03:00
|
|
|
- Start a remote interactive shell on the emulator or device:
|
2020-08-30 20:20:36 -03:00
|
|
|
|
|
|
|
`adb shell`
|
|
|
|
|
2020-09-04 06:57:14 -03:00
|
|
|
- Get all the properties from emulator or device:
|
|
|
|
|
|
|
|
`adb shell getprop`
|
|
|
|
|
2020-08-30 20:20:36 -03:00
|
|
|
- Revert all runtime permissions to their default:
|
|
|
|
|
|
|
|
`adb shell pm reset-permissions`
|
|
|
|
|
|
|
|
- Revoke a dangerous permission for an application:
|
|
|
|
|
|
|
|
`adb shell pm revoke {{package}} {{permission}}`
|
|
|
|
|
|
|
|
- Trigger a key event:
|
|
|
|
|
|
|
|
`adb shell input keyevent {{keycode}}`
|
|
|
|
|
|
|
|
- Clear the data of an application on an emulator or device:
|
|
|
|
|
|
|
|
`adb shell pm clear {{package}}`
|
|
|
|
|
2023-02-19 08:39:26 -03:00
|
|
|
- Start an activity on emulator or device:
|
2020-08-30 20:20:36 -03:00
|
|
|
|
|
|
|
`adb shell am start -n {{package}}/{{activity}}`
|
|
|
|
|
|
|
|
- Start the home activity on an emulator or device:
|
|
|
|
|
|
|
|
`adb shell am start -W -c android.intent.category.HOME -a android.intent.action.MAIN`
|