adb Verified current stable Not installed? Programming

Adb / Revoke App Permission

Revoke App Permission

Revokes specified permissions from an application on the device.

$
Terminal
adb shell pm revoke <package> <android.permission.CAMERA|android.permission.ACCESS_FINE_LOCATION|android.permission.READ_CONTACTS|...>

When To Use

Necessary for security audits or when debugging unwanted behavior from an application.

Pro Tip

Perform revocation in an isolation environment to prevent user data integrity issues caused by abrupt permission loss.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
adb shell pm revoke <package> <android.permission.CAMERA|android.permission.ACCESS_FINE_LOCATION|android.permission.READ_CONTACTS|...>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
PACKAGE_NAME: com.example.app

Permissions revoked:
- android.permission.CAMERA
- android.permission.ACCESS_FINE_LOCATION

Operation completed successfully.

Anatomy of Output

Understanding the result

Success Revoke Status

Indicates whether the permissions were successfully revoked.

Revoked permission: android.permission.ACCESS_FINE_LOCATION Revoked Permission Notification

Confirms specific permissions revoked from the application.

Total Permissions Revoked: 1 Summary Count

Total number of permissions revoked during operation.

Troubleshooting

Common pitfalls

adb shell pm revoke: Package not found

Solution: Verify the package name is correct and that the app is installed.

adb shell pm revoke: Permission <permission_name> is not a valid permission

Solution: Check for spelling and ensure the permission is applicable to the app.

adb shell pm revoke: Operation failed

Solution: Inspect device policies or user settings for related restrictions.

Command Breakdown

What each part is doing

adb
Base Command
The executable that performs this operation. Here it runs Adb before the shell applies any redirect operators.
<package>
package
The value supplied for package.
<android.permission.CAMERA|android.permission.ACCESS_FINE_LOCATION|android.permission.READ_CONTACTS|...>
android.permission.CAMERA|android.permission.ACCESS FINE LOCATION|android.permission.READ CONTACTS|...
The value supplied for android.permission.CAMERA|android.permission.ACCESS FINE LOCATION|android.permission.READ CONTACTS|....

How To Run

Execution path

  1. Step 1

    Run the command: `adb shell pm revoke com.example.app android.permission.CAMERA`

  2. Step 2

    Verify permissions by running: `adb shell pm list packages -f -3`

Alternative Approaches

Comparable commands in other tools

Alternative programming tools for the same job.