Call device policy manager (dpm)

To help you develop and test your device management (or other enterprise) apps, you can issue commands to the device policy manager (dpm) tool. Use the tool to control the active admin app or change a policy's status data on the device. You can issue a device policy manager command directly from adb without entering a remote shell:

adb shell dpm command

Command

Set component as active admin. Options are:

adb shell dpm set-active-admin [options] component

Set component as active admin and its package as profile owner for an existing user. Options are:

adb shell dpm set-profile-owner [options] component

Set component as active admin and its package as device owner. Options are:

adb shell dpm set-device-owner [options] component

Disable an active admin. The app must declare android:testOnly in the manifest. This command also removes device and profile owners. Options are:

adb shell dpm remove-active-admin [options] component