Device state manager (device_state) commands:
help
Print this help text.
state [reset|OVERRIDE_DEVICE_STATE]
Return or override device state.
print-state
Return the current device state.
print-states
Return list of currently supported device states.
print-states-simple
Return the currently supported device states in comma separated format.
```bash
adb shell cmd device_state
```
<details>
<summary>Output:</summary>
```
Device state manager (device_state) commands:
help
Print this help text.
state [reset|OVERRIDE_DEVICE_STATE]
Return or override device state.
print-state
Return the current device state.
print-states
Return list of currently supported device states.
print-states-simple
Return the currently supported device states in comma separated format.
```
</details>
```bash
adb shell cmd device_state print-states
```
<details>
<summary>Output:</summary>
```
Supported states: [
DeviceState{identifier=0, name='DEFAULT', app_accessible=true, cancel_when_requester_not_on_top=false},
]
```
</details>
Usage: input [<source>] [-d DISPLAY_ID] <command> [<arg>...]
The sources are:
touchnavigation
touchscreen
joystick
stylus
touchpad
gamepad
dpad
mouse
keyboard
trackball
rotaryencoder
[axis_value] represents an option specifying the value of a given axis
The syntax is as follows: --axis <axis_name>,<axis_value>
where <axis_name> is the name of the axis as defined in
MotionEvent without the AXIS_ prefix (e.g. SCROLL, X)
Sample [axis_values] entry: `--axis Y,3`, `--axis SCROLL,-2`
-d: specify the display ID.
(Default: -1 for key event, 0 for motion event if not specified.)
The commands and default sources are:
text <string> (Default: keyboard)
keyevent [--longpress|--duration <duration to hold key down in ms>] [--doubletap] [--async] [--delay <duration between keycodes in ms>] <key code number or name> ... (Default: keyboard)
tap <x> <y> (Default: touchscreen)
swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
press (Default: trackball)
roll <dx> <dy> (Default: trackball)
motionevent <DOWN|UP|MOVE|CANCEL> <x> <y> (Default: touchscreen)
scroll (Default: rotaryencoder). Has the following syntax:
scroll <x> <y> [axis_value] (for pointer-based sources)
scroll [axis_value] (for non-pointer-based sources)
Axis options: SCROLL, HSCROLL, VSCROLL
None or one or multiple axis value options can be specified.
To specify multiple axes, use one axis option for per axis.
Example: `scroll --axis VSCROLL,2 --axis SCROLL,-2.4`
keycombination [-t duration(ms)] <key code 1> <key code 2> ... (Default: keyboard, the key order is important here.)
```bash
adb shell cmd input
```
<details>
<summary>Output:</summary>
```
Usage: input [<source>] [-d DISPLAY_ID] <command> [<arg>...]
The sources are:
touchnavigation
touchscreen
joystick
stylus
touchpad
gamepad
dpad
mouse
keyboard
trackball
rotaryencoder
[axis_value] represents an option specifying the value of a given axis
The syntax is as follows: --axis <axis_name>,<axis_value>
where <axis_name> is the name of the axis as defined in
MotionEvent without the AXIS_ prefix (e.g. SCROLL, X)
Sample [axis_values] entry: `--axis Y,3`, `--axis SCROLL,-2`
-d: specify the display ID.
(Default: -1 for key event, 0 for motion event if not specified.)
The commands and default sources are:
text <string> (Default: keyboard)
keyevent [--longpress|--duration <duration to hold key down in ms>] [--doubletap] [--async] [--delay <duration between keycodes in ms>] <key code number or name> ... (Default: keyboard)
tap <x> <y> (Default: touchscreen)
swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
press (Default: trackball)
roll <dx> <dy> (Default: trackball)
motionevent <DOWN|UP|MOVE|CANCEL> <x> <y> (Default: touchscreen)
scroll (Default: rotaryencoder). Has the following syntax:
scroll <x> <y> [axis_value] (for pointer-based sources)
scroll [axis_value] (for non-pointer-based sources)
Axis options: SCROLL, HSCROLL, VSCROLL
None or one or multiple axis value options can be specified.
To specify multiple axes, use one axis option for per axis.
Example: `scroll --axis VSCROLL,2 --axis SCROLL,-2.4`
keycombination [-t duration(ms)] <key code 1> <key code 2> ... (Default: keyboard, the key order is important here.)
```
</details>
Usage: cmd launcherapps COMMAND [options ...]
cmd launcherapps dump-view-hierarchies
Output captured view hierarchies. Files will be generated in
`/data/misc/wmtrace/`. After pulling the data to your device,
you can upload / visualize it at `go/winscope`.
```bash
adb shell cmd launcherapps
```
<details>
<summary>Output:</summary>
```
Usage: cmd launcherapps COMMAND [options ...]
cmd launcherapps dump-view-hierarchies
Output captured view hierarchies. Files will be generated in
`/data/misc/wmtrace/`. After pulling the data to your device,
you can upload / visualize it at `go/winscope`.
```
</details>
Role (role) commands:
help or -h
Print this help text.
get-role-holders [--user USER_ID] ROLE
add-role-holder [--user USER_ID] ROLE PACKAGE [FLAGS]
remove-role-holder [--user USER_ID] ROLE PACKAGE [FLAGS]
clear-role-holders [--user USER_ID] ROLE [FLAGS]
set-bypassing-role-qualification true|false
get-active-user-for-role [--user USER_ID] ROLE
set-active-user-for-role [--user USER_ID] ROLE ACTIVE_USER_ID [FLAGS]
```bash
adb shell cmd role
```
<details>
<summary>Output:</summary>
```
Role (role) commands:
help or -h
Print this help text.
get-role-holders [--user USER_ID] ROLE
add-role-holder [--user USER_ID] ROLE PACKAGE [FLAGS]
remove-role-holder [--user USER_ID] ROLE PACKAGE [FLAGS]
clear-role-holders [--user USER_ID] ROLE [FLAGS]
set-bypassing-role-qualification true|false
get-active-user-for-role [--user USER_ID] ROLE
set-active-user-for-role [--user USER_ID] ROLE ACTIVE_USER_ID [FLAGS]
```
</details>
Settings provider (settings) commands:
help
Print this help text.
get [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE KEY
Retrieve the current value of KEY.
put [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE KEY VALUE [TAG] [default] [overrideableByRestore]
Change the contents of KEY to VALUE.
TAG to associate with the setting (cannot be default or overrideableByRestore).
{default} to set as the default, case-insensitive only for global/secure namespace
{overrideableByRestore} to let the value be overridden by BackupManager on restore operations
delete [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE KEY
Delete the entry for KEY.
reset [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE {PACKAGE_NAME | RESET_MODE}
Reset the global/secure table for a package with mode.
RESET_MODE is one of {untrusted_defaults, untrusted_clear, trusted_defaults}, case-insensitive
list [--user <USER_ID> | current] [--lineage] NAMESPACE
Print all defined keys.
NAMESPACE is one of {system, secure, global}, case-insensitive
```bash
adb shell cmd settings
```
<details>
<summary>Output:</summary>
```
Settings provider (settings) commands:
help
Print this help text.
get [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE KEY
Retrieve the current value of KEY.
put [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE KEY VALUE [TAG] [default] [overrideableByRestore]
Change the contents of KEY to VALUE.
TAG to associate with the setting (cannot be default or overrideableByRestore).
{default} to set as the default, case-insensitive only for global/secure namespace
{overrideableByRestore} to let the value be overridden by BackupManager on restore operations
delete [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE KEY
Delete the entry for KEY.
reset [--user <USER_ID> | current] [--deviceId <DEVICE_ID> | 0] [--lineage] NAMESPACE {PACKAGE_NAME | RESET_MODE}
Reset the global/secure table for a package with mode.
RESET_MODE is one of {untrusted_defaults, untrusted_clear, trusted_defaults}, case-insensitive
list [--user <USER_ID> | current] [--lineage] NAMESPACE
Print all defined keys.
NAMESPACE is one of {system, secure, global}, case-insensitive
```
</details>
User manager (user) commands:
help
Prints this help text.
list [-v | --verbose] [-V | --very-verbose] [--all]
Prints all users on the system.
report-system-user-package-whitelist-problems [-v | --verbose] [--critical-only] [--mode MODE]
Reports all issues on user-type package allowlist XML files. Options:
-v | --verbose: shows extra info, like number of issues
--critical-only: show only critical issues, excluding warnings
--mode MODE: shows what errors would be if device used mode MODE
(where MODE is the allowlist mode integer as defined by config_userTypePackageWhitelistMode)
set-system-user-mode-emulation [--reboot | --no-restart] <headless | full | default>
Changes whether the system user is headless, full, or default (as defined by OEM).
WARNING: this command is meant just for development and debugging purposes.
It should NEVER be used on automated tests.
NOTE: by default it restarts the Android runtime, unless called with
--reboot (which does a full reboot) or
--no-restart (which requires a manual restart)
is-headless-system-user-mode [-v | --verbose]
Checks whether the device uses headless system user mode.
is-visible-background-users-on-default-display-supported [-v | --verbose]
Checks whether the device allows users to be start visible on background in the default display.
It returns the effective mode, even when using emulation
(to get the real mode as well, use -v or --verbose)
is-visible-background-users-supported [-v | --verbose]
Checks whether the device allows users to be start visible on background.
It returns the effective mode, even when using emulation
(to get the real mode as well, use -v or --verbose)
is-user-visible [--display DISPLAY_ID] <USER_ID>
Checks if the given user is visible in the given display.
If the display option is not set, it uses the user's context to check
(so it emulates what apps would get from UserManager.isUserVisible())
get-main-user
Displays main user id or message if there is no main user
grant-admin <USER_ID>
Grants admin privileges to the given user (requires adb root)
revoke-admin <USER_ID>
Revokes admin privileges from the given user (requires adb root)
```bash
adb shell cmd user
```
<details>
<summary>Output:</summary>
```
User manager (user) commands:
help
Prints this help text.
list [-v | --verbose] [-V | --very-verbose] [--all]
Prints all users on the system.
report-system-user-package-whitelist-problems [-v | --verbose] [--critical-only] [--mode MODE]
Reports all issues on user-type package allowlist XML files. Options:
-v | --verbose: shows extra info, like number of issues
--critical-only: show only critical issues, excluding warnings
--mode MODE: shows what errors would be if device used mode MODE
(where MODE is the allowlist mode integer as defined by config_userTypePackageWhitelistMode)
set-system-user-mode-emulation [--reboot | --no-restart] <headless | full | default>
Changes whether the system user is headless, full, or default (as defined by OEM).
WARNING: this command is meant just for development and debugging purposes.
It should NEVER be used on automated tests.
NOTE: by default it restarts the Android runtime, unless called with
--reboot (which does a full reboot) or
--no-restart (which requires a manual restart)
is-headless-system-user-mode [-v | --verbose]
Checks whether the device uses headless system user mode.
is-visible-background-users-on-default-display-supported [-v | --verbose]
Checks whether the device allows users to be start visible on background in the default display.
It returns the effective mode, even when using emulation
(to get the real mode as well, use -v or --verbose)
is-visible-background-users-supported [-v | --verbose]
Checks whether the device allows users to be start visible on background.
It returns the effective mode, even when using emulation
(to get the real mode as well, use -v or --verbose)
is-user-visible [--display DISPLAY_ID] <USER_ID>
Checks if the given user is visible in the given display.
If the display option is not set, it uses the user's context to check
(so it emulates what apps would get from UserManager.isUserVisible())
get-main-user
Displays main user id or message if there is no main user
grant-admin <USER_ID>
Grants admin privileges to the given user (requires adb root)
revoke-admin <USER_ID>
Revokes admin privileges from the given user (requires adb root)
```
</details>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Output:
on my Fairphone 4 LineageOS 23.0.
Would help Benjamin_Loison/Backup_Android_apps/issues/51#issuecomment-10148871.
On Linux Mint 22.3 Cinnamon Framework 13 Virtual Machine Manager LineageOS 23.0 virtual machine for safety:
Bash script:
Output:
Only:
hang for at least 2 seconds.
143 entries are kept among initial 263 ones.
96 kept entries after excluding such commands.
Bash script:
Output:
Output:
Output:
Output:
Output:
Related to Benjamin_Loison/Voice_assistant/issues/40.
Output:
Output:
Output:
I checked all entries.