0

I am testing the wso2 emm on an android device. I have set up the EMM server and linked an android device to it by just enrolling the device to the server instead of setting up the work profile. In order to apply some policies like Restricting Bluetooth access, the agent application should be a device owner. How do i set my device as a device owner? Is it possibile only programmatically using 'dpm' or is there any way to do it via the application settings on the phone?

Thank you

Community
  • 1
  • 1
Spathire
  • 1
  • 1

2 Answers2

0

You can set the agent as Device Owner using adb commands.

adb shell dpm set-device-owner

Beware there is no counter function to undo this operation via adb. A workaround can be done like this. There is a deprecated method in device policy manager called;

clearDeviceOwnerApp(String packageName)

(https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#clearDeviceOwnerApp(java.lang.String)

You may create additional button in the agent and implement to execute this method when needed. Otherwise you will have to reset your device in get rid of that (As I know).

The other way is provisioning the device as a Kiosk Device. If you follow those steps, the agent will be installed as the device owner. The kiosk mode will be available on the next release with the docs.

PasinduJay
  • 487
  • 5
  • 17
0

you can set your the device owner using ADB (Android Debug Bridge).

  1. Make sure to remove all your google accounts before you do this or if you are okay, do a factory reset.
  2. Install ADB (Android Debug Bridge) to your machine : Install Android Debug Bride in Mac, Linux and Windows
  3. Enable Developer mode Settings -> Build Number (tap 7 times to activate the developer mode).
  4. Enable Usb Debugging. go to Developer Option -> Enable Usb Debug.
  5. Connect your device to your laptop or desktop. go to your terminal or cmd or powershell. then use adb devices to check whether your device is connected properly. it will show your device.
  6. Install WSO2 android agent .apk by downloading or using ADB.
  7. Do the enrollment.
  8. Then you can set device owner as WSO2 agent app with below command.

adb shell dpm set-device-owner org.wso2.iot.agent/.services.AgentDeviceAdminReceiver

This allows the device owner mode.

For more details see : How to enroll android device to wso2 mdm in device owner mode

caldera.sac
  • 4,918
  • 7
  • 37
  • 69