@@ -23,14 +23,65 @@ You can find various kinds of provisioning methods [here](https://developers.goo
23233 . Modify (if needed) and scan [ this QR code] (http://down-box.appspot.com/qr/nQB0tw7b ).
24244 . Follow onscreen instructions
2525
26- #### ADB command (Device Owner) ####
26+ #### ADB command ####
2727
28- ``` shell
29- adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver
30- ```
28+ ** Device Owner**
3129
32- #### Work profile ####
33- The easiest way is to launch the "Set Up TestDPC" app in launcher and follow the onscreen instructions.
30+ * Run the ` adb ` command:
31+
32+ ``` console
33+ adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver
34+ ```
35+
36+ **Profile Owner**
37+
38+ * Create a managed profile by launching the “Set up TestDPC” app (if this app
39+ seems broken and you are in dark mode, switch to light mode)
40+ * Skip adding an account at the end of the flow
41+
42+ **COPE Profile Owner**
43+
44+ * Create a managed profile by launching the “Set up TestDPC” app (if this app
45+ seems broken and you are in dark mode, switch to light mode)
46+ * Skip adding an account at the end of the flow
47+ * Run the `adb` command:
48+
49+ ```console
50+ adb shell dpm mark-profile-owner-on-organization-owned-device --user 10 com.afwsamples.testdpc/.DeviceAdminReceiver`
51+ ```
52+
53+ ## TestDPC as DM role holder
54+
55+ TestDPC v9.0.5+ can be setup as Device Management Role Holder.
56+
57+ * Running the following `adb` commands:
58+
59+ ```console
60+ adb shell cmd role set-bypassing-role-qualification true
61+ adb shell cmd role add-role-holder android.app.role.DEVICE_POLICY_MANAGEMENT com.afwsamples.testdpc
62+ ```
63+
64+ Note: unlike DO/PO, this change is not persisted so TestDPC needs to be
65+ marked as role holder again if the device reboots.
66+
67+ Android Studio import
68+ ---------------------
69+
70+ To import this repository in Android Studio, you need to use the
71+ [Bazel for IntelliJ](https://plugins.jetbrains.com/plugin/8609-bazel-for-intellij)
72+ Plugin.
73+
74+ When importing the project you have to select the folder containing the Bazel's
75+ `BUILD` file. When prompted to select a "project view", you can choose the
76+ option "Copy external" and choose the `scripts/ij.bazelproject` available in
77+ this repository.
78+
79+ Once Bazel has complete the import operation and the first sync of the
80+ project, you can create a "Run Configuration".
81+ Select "Bazel Command" as Configuration type and add `//:testdpc` as
82+ "target expression".
83+
84+ You can now run the project from inside Android Studio.
3485
3586Support
3687-------
0 commit comments