Provision Test DPC as Device Owner (DO)
masterTo set up Test DPC as the Device Owner, use one of the following methods:
AFW# code provisioning (Android M+)
- Factory reset your device.
- Set up Wi-Fi.
- When prompted to sign in, enter
afw#testdpc. - Follow onscreen instructions. Choose 'Use for work only' for a fully managed setup.
QR code provisioning (Android N+)
- Factory reset your device and tap the welcome screen in the setup wizard 6 times.
- Generate a QR code containing the following JSON payload:
{ "android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.afwsamples.testdpc/com.afwsamples.testdpc.DeviceAdminReceiver", "android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "gJD2YwtOiWJHkSMkkIfLRlj-quNqG1fb6v100QmzM9w=", "android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://testdpc-latest-apk.appspot.com" } - Scan the QR code and follow onscreen instructions.
Note: If the device hangs on the configuring screen, it may be unable to connect to the appspot.com domain. You can host the APK on your own server and update the PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION key in the JSON before generating the QR code.
ADB command
Run the following command via ADB:
adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiveradb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver