Permissions & Security
Android 4.3+ (API 18+)
Risk: MODIFIES_DEVICE
Set AppOps Permission / Operation Mode
Modifies low-level Android AppOps operation modes (allow, ignore, deny) for fine-grained privacy control.
Command Syntax
adb shell appops set
Generic Syntax:
appops set [--user <USER_ID>] <package_name> <OP_NAME> <allow|deny|ignore|default>
Options & Parameters
| Flag | Description |
|---|---|
| <OP_NAME> | Operation identifier (e.g. SYSTEM_ALERT_WINDOW, COARSE_LOCATION, READ_CLIPBOARD). |
| allow | Grant permission. |
| ignore | Silently mock/suppress access without crashing the app. |
| deny | Strictly deny operation. |
| default | Reset to system default behavior. |
Real-World Usage Examples
Allow draw over other apps (Overlay)
Grants overlay permission without user prompt.
adb shell appops set com.example.app SYSTEM_ALERT_WINDOW allow
Disable background execution for battery saving
Blocks app from running when in background.
adb shell appops set com.example.app RUN_IN_BACKGROUND ignore
Grant Special Access (Usage Stats)
Allows reading app usage time statistics.
adb shell appops set com.example.app GET_USAGE_STATS allow