Setting up Device Testing
These are the essential elements that must exist for OEM devices to ensure minimal support for managed profiles:
- Profile Owner as described in
- Device Owner
- Activation Code Provisioning
See for the complete list of requirements.
Summary
To test your device administration features:
- For device owner, use the test app.
- Consider working with other enterprise mobility management (EMM) providers directly.
Set up the device owner for testing
- Device MUST be built with userdebug or eng build.
- Factory reset the target device (and continue with the next steps in the meantime).
- Download . (Also see the documentation.)
- Unzip the file.
- Navigate (
cd
) to the unzipped directory. - If you don't have it, download the package.
- Create a file with the name
local.properties
containing the following single line:sdk.dir=<path to your android SDK folder>
- On Linux and Mac OS, run:
./gradlew assembleDebug
Or on windows run:gradlew.bat assembleDebug
- If the build is unsuccessful because you have an outdated android SDK, run:
<your android sdk folder>/tools/android update sdk -u -a
- Wait for factory reset to complete if it hasn’t yet.
Caution: Stay on the first screen after factory reset and do not finish the setup wizard.
- Install the BasicManagedProfile app by running the following command:
adb install ./Application/build/outputs/apk/Application-debug.apk
- Set this app as the device owner by running this command:
$ adb shell am start -a com.android.managedprovisioning.ACTION_PROVISION_MANAGED_DEVICE --es android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME com.example.android.basicmanagedprofile
- Go through device owner setup on the device (encrypt, select Wi-Fi, etc.)
Verify the device owner was correctly setup
-
- Go to Settings > Security > Device Administrators.
- Confirm the BasicManagedProfile is in the list and verify it cannot be disabled. (This signifies it is a device owner.)