Skip to content

Device Policy Management on Android with ADB


Prints the help text

dpm help

Checks if the given operation is safe

dpm is-operation-safe <OPERATION_ID>

Checks if the operations are safe for the given reason

dpm is-operation-safe-by-reason <REASON_ID>

Emulates the result of the next call to check if the given operation is safe

dpm set-operation-safe <OPERATION_ID> <REASON_ID>

Lists the device / profile owners per user

dpm list-owners

Lists the apps that are exempt from policies

dpm list-policy-exempt-apps

Sets the given component as active admin for an existing user

dpm set-active-admin [ --user <USER_ID> | current ] <COMPONENT>

Sets the given component as active admin, and its package as device owner

dpm set-device-owner [ --user <USER_ID> | current *EXPERIMENTAL* ] [ --device-owner-only ] <COMPONENT>

Sets the given component as active admin and profile owner for an existing user

dpm set-profile-owner [ --user <USER_ID> | current ] <COMPONENT>

Disables an active admin, the admin must have declared android:testOnly in the application in its manifest

dpm remove-active-admin [ --user <USER_ID> | current ] <COMPONENT>

Clears framework-maintained record of past freeze periods that the device went through

dpm clear-freeze-period-record

Makes all network logs available to the DPC and triggers DeviceAdminReceiver.onNetworkLogsAvailable()

dpm force-network-logs

Makes all security logs available to the DPC and triggers DeviceAdminReceiver.onSecurityLogsAvailable() if needed

dpm force-security-logs

Marks the profile owner of the given user as managing an organization-owned device

dpm mark-profile-owner-on-organization-owned-device [ --user <USER_ID> | current ] <COMPONENT>