Setting up Device Testing

Setting up Device Testing

These are the essential elements that must exist for OEM devices to ensure minimal support for managed profiles:

See Implementing Device Administration for the complete list of requirements.

Summary


To test your device administration features:

  1. For device owner, use the BasicManagedProfile.apk test app.
  2. Consider working with other enterprise mobility management (EMM) providers directly.

Set up the device owner for testing


  1. Device MUST be built with userdebug or eng build.
  2. Factory reset the target device (and continue with the next steps in the meantime).
  3. Download BasicManagedProfile.zip. (Also see the BasicManagedProfile documentation.)
  4. Unzip the file.
  5. Navigate (cd) to the unzipped directory.
  6. If you don't have it, download the Android SDK Tools package.
  7. Create a file with the name local.properties containing the following single line:
    sdk.dir=<path to your android SDK folder>
  8. On Linux and Mac OS, run:
    ./gradlew assembleDebug
    Or on windows run:
    gradlew.bat assembleDebug
  9. If the build is unsuccessful because you have an outdated android SDK, run:
    <your android sdk folder>/tools/android update sdk -u -a
  10. 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.

  11. Install the BasicManagedProfile app by running the following command:
    adb install ./Application/build/outputs/apk/Application-debug.apk
  12. 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
  13. Go through device owner setup on the device (encrypt, select Wi-Fi, etc.)

Verify the device owner was correctly setup


    1. Go to Settings > Security > Device Administrators.
    2. Confirm the BasicManagedProfile is in the list and verify it cannot be disabled. (This signifies it is a device owner.)
posted @ 2016-04-20 10:48  dolinux  阅读(329)  评论(0)    收藏  举报