G33K-TRICKS: Complete Guide and steps to Install, Setup and Remove Test DPC app

Saturday, August 1, 2020

Complete Guide and steps to Install, Setup and Remove Test DPC app


how to uninstall test DPC

What is Test DPC

TestDPC / Test DPC is an app that is used for testing Device Policy Controller for Android Devices. This app was released by Google first in 2015. This app is smart enough to fool your Android device thinking that it is being used under a corporate context. If you are an Android App developer and want to test a specific behaviour of your app under the conditions when the device would be enrolled to Work Managed or Work Profile Mode by an EMM like WorkspaceOne Intelligent Hub.
Once you set the device to Device Owner or Work Managed / Work Profile mode using the TestDPC app, you can verify the remote app performance.
If you want to understand more on Work Managed and Work Profile, you can refer this article: Difference-between-Work-Profile-and-Work-Managed-Profile
And if you are here to see how to uninstall VMware Workspace One Hub, you can refer to this link - https://g33ktricks.blogspot.com/2022/09/how-to-Uninstall-vmware-workspaceone-Intelligent-hub-android.html

This app can be downloaded easily from the below official links and there are other links from where you can download it too.

Test DPC Git Hub Download Link: https://github.com/googlesamples/android-testdpc
The Source code is available for Free for this app in GitHub, so you can play around with it.

What Test DPC app does?

Android Device comes with Device Policy Controller (DPC) which controls most of the device Settings. These settings can be controlled manually, that you do from Settings but these can be also can be controlled by Enterprise Mobility Management) ISVs (Independent Software Vendor) OEMs (Original Equipment Manufacturer) 
Users can manage security polices , can set applications restrictions and much more things using this app. It also has as a implementation reference for other DPCs.
For using Test DPC app, device Rooting is not required.

List of APIs available in Test DPC app

Below are the images from the Test DPC app 7.0 and the complete list of Policy Management APIs available within the app. Few of the setting in the main menu will have Sub-Settings which are not included in the list of screenshots.
 
Here is the list of few of the DPC commands followed by Screenshots from the test DPC apk.
Suspend apps, Unsuspend apps, Clear app data, Managed configuration, Disable metered data , app feedback notification, App restrictions manager,  Delegated cert installer, generic delegation, lock task mode, Manage app permissions,Wipe etc.

.
List of APIs Methods available in Test DPC app                   List of APIs Methods available in Test DPC app                List of APIs Methods available in Test DPC app


List of APIs Methods available in Test DPC app                 List of APIs Methods available in Test DPC app               List of APIs Methods available in Test DPC app

List of APIs Methods available in Test DPC app                 List of APIs Methods available in Test DPC app              
List of APIs Methods available in Test DPC app                 List of APIs Methods available in Test DPC app          
List of APIs Methods available in Test DPC app                 List of APIs Methods available in Test DPC app               List of APIs Methods available in Test DPC app


Installing test DPC

For setting the device to Device Owner or Work Managed Mode, you can use the adb command without factory resetting the mobile device. The Current or the latest version available is for test DPC app is 7.0.

Steps for Installing testDPC app from Google Play Store

- To install, you must connect your Gmail account to your Android device.
- To download from Play Store
- Click ‘Accept’ for permissions and let it download
- Once Test DPC is installed from Play Store. 
- Follow the steps below given in the   Test DPC Initial Setup section

Steps for Installing testDPC app via command line via apk

- After downloading, go to Device Settings and then Security.
- Search for ‘Allow installation of apps from unknown sources’ and enable the option.
- Install any APK using below steps
  (Here is the complete guide to setup ADB on your machine - https://www.xda-developers.com/install-adb-windows-macos-linux)

- Install the DPC apk from adb
 adb install <TestDPC.apk>

- And run below command to set the dpc app as Device Owner.
 adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver

- In case you want to test the Profile Owner mode, you need to run below command instead of above Device Owner command
 adb shell dpm set-profile-owner com.afwsamples.testdpc/.DeviceAdminReceiver

Test DPC Initial Setup:

Below screenshots would explain you the initial setup.
Launch the Test DPC app after installing and follow the instructions as given below.

Installing and settting Test DPC app             Installing and settting Test DPC app            Installing and settting Test DPC appInstalling and settting Test DPC app            Test DPC in Personal container              Test DPC in Work Profile


Test DPC is one of the best Device Policy controller for Android devices and it is compatible with devices running on Lollipop (Android 5.0) and higher. 

Uninstalling / Removing Test DPC apk

 By now you must have understood, this app is very useful but I would suggest you to uninstall it once you are done with your work. Keeping it on your device and playing around it might land you in trouble.
Here are the steps to follow for removing the Test DPC app/apk.
From the below screenshot from the device you can see that there is a Wipe Option to clear the dpc set up from the device.

                                                             Test DPC Wipe option
- Launch the Test DPC application 
- Search for "Wipe" option 
- Click "Ok" on the prompt
- Remove the test DPC Apk from Device Apps list,  Go to Device Settings > Apps > search app and click Uninstall

 I see that people do look for removing other DPC apps like thinkadam dpc, Intelligent Hub from VMware or Microsofts Intune. Just to let you know, there is no way to remove these apps. If your device is enrolled as Device Owner, un-enrolling it would factory reset the device. If its enrolled as Profile owner there are chances but the only thing that blocks it is ofcourse the IT team of your company. If they have installed it on your device, they do not want it to remove it. If you want the DPC apps like mentioned above, to be removed from you mobile device, you need to contact to your IT team. 

NOTE: Sooner, the testDPC will be out of sight and will be over taken by AMAPI. The new concept that would control your device instead of DPC apps. Click here , if you want to learn more about AMAPI.

You might also like to look at this quick small article on Android emulator Camera Surprise : Android-emulator-camera-surprise

No comments: