Description
Test DPC (Device Policy Controller) is a free application aimed exclusively for development and testing purposes in Android Enterprise environments. It allows developers, original equipment manufacturers (OEMs), independent software vendors (ISVs), and enterprise mobility managers (EMMs) to simulate and test Android device management policies in controlled scenarios, such as work profiles or devices set up as device owner.
What is Test DPC?
Test DPC is an open-source tool that acts as a sample device policy controller (DPC) for Android Enterprise. It was developed to allow users to test how their applications or device settings behave in a managed environment, without needing to integrate a complete mobile device management (MDM/EMM) system like Intune. The application simulates administration policies, application restrictions, and security configurations, helping to ensure that applications comply with corporate security and management requirements.
The application is explicitly intended for development and should not be used in production environments or with real data. It is widely used to test Android Enterprise APIs and understand how policies affect the behavior of applications and devices.
Main Features
Test DPC offers a wide range of features to simulate Android device management scenarios. Here are the key features, with details:
- Creation and Management of Work Profiles:
- Test DPC allows the configuration of a work profile on Android devices, separating personal applications and data from corporate ones. This is essential for testing application behavior in BYOD (Bring Your Own Device) usage scenarios.
- The work profile can be activated during the initial device setup or on already used devices, allowing the simulation of separation between personal and professional environments.
- Management of Security Policies:
- Allows the application of security policies, such as:
- Password Restrictions: Test different password requirements, such as complexity or auto-lock time.
- Disabling Features: Block device features, such as the camera, screenshots, file transfer via USB, or app installation.
- Network Settings: Test Wi-Fi or VPN settings, such as secure connections or network access restrictions.
- These policies help verify how applications respond to restrictions imposed by a corporate administrator.
- Application Restrictions:
- Test DPC allows you to set specific restrictions for applications, such as limiting app installation or removal, defining mandatory permissions, or blocking specific functionalities within an application.
- It also supports testing of managed configurations, allowing developers to simulate how their applications behave under corporate policies.
- Simulation of Device Owner and Profile Owner Scenarios:
- The application can be configured as a device owner or profile owner, simulating scenarios where the device is fully managed (such as in corporate devices) or only the work profile is controlled.
- This is useful for testing advanced configurations, such as device provisioning or managing devices in kiosk mode.
- Testing of Android Enterprise APIs:
- Test DPC serves as an implementation reference for other DPCs, allowing developers to explore and test specific Android Enterprise APIs, such as:
- DevicePolicyController.requestBugReport: To collect bug reports on managed devices.
- DeviceAdminReceiver: To receive results of actions such as bug reports or policy changes.
- It supports testing at different API levels, allowing verification of compatibility with various Android versions.
- Support for Advanced Configurations:
- Starting from version 9.0.5, Test DPC can be configured as a Device Management Role Holder, a feature that allows managing specific device management roles.
- Includes support for eSIM configurations, UWB (Ultra-Wideband), and credential management options.
- Export of Managed Configurations:
- A modified version of Test DPC, mentioned in some sources, allows exporting managed configurations to a JSON file, facilitating bulk testing and reimporting configurations. This feature is not available in the standard version but demonstrates the flexibility of the application due to its open-source nature.
- Integration with OEMConfig:
- Test DPC can be used to manually configure OEM agents, such as Lenovo OEM Config, allowing the testing of specific manufacturer configurations in a managed environment.
System Requirements
- Android Version: Compatible with Android 5.0 (Lollipop) or higher.
- Device: Can be installed on personal or corporate devices, provided they are not managed by another DPC.
- Permissions: Requires 41 permissions, including access to device administrative settings, which is necessary to simulate management policies.
How to Set Up and Use
- Installation:
- Download the APK by clicking the download button at the beginning of the page.
- Enable "Unknown Sources" in security settings and install the file.
- During Initial Setup:
- After resetting the device, on the welcome screen of the setup wizard, type afw#testdpc in the email field to start provisioning as device owner.
- Profile Configuration:
- Open the Test DPC application and follow the instructions to set up a work profile or set the app as device owner.
- Use ADB commands, such as adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver, to configure the app as device owner.
- Policy Testing:
- In the application, access the policy management options to apply restrictions, such as disabling the camera, setting passwords, or limiting applications.
- Test the behavior of applications installed in the work profile or the managed device.
- Uninstallation:
- To remove Test DPC, deactivate it as a device administrator in Android settings (Settings > Security > Device Administrators).
- Then uninstall the app normally. Note that removing the work profile also deletes the associated data.
Limitations
- Does Not Support Mass Configurations: The standard version of Test DPC does not allow testing configurations on a large scale, which can be cumbersome for extensive testing.
- API Restrictions: Some policies are not available on devices with older versions of Android, due to API limitations.
- Deactivation Issues: Some users report difficulties disabling settings applied by Test DPC, especially on older devices, which may require additional ADB commands or factory resets.
- Not for Production Use: As emphasized, the application is not suitable for managing devices in real environments, being exclusively for testing.
Use Cases
- App Developers: Test how applications behave under corporate restrictions, such as blocking features or managed settings.
- EMM Administrators: Validate management policies before implementing them in an MDM/EMM system.
- OEMs: Configure and test specific manufacturer agents (OEMConfig) in managed devices.
- Security Testing: Simulate security scenarios, such as blocking devices, enforcing passwords, or network restrictions.
Alternatives and Considerations
Although Test DPC is a powerful tool, it is not the only option for device management testing. Alternatives include:
- Complete EMM Solutions: Such as Microsoft Intune or VMware Workspace ONE, which offer more robust testing environments but require integration.
- Third-Party Tools: Some tools, like Dr.Fone, offer functionalities for device management but are not focused on development like Test DPC.
Conclusion
Test DPC is an essential tool for developers and administrators who need to test Android device management policies in a controlled environment. With its ability to simulate work profiles, apply security restrictions, and test Android Enterprise APIs, it is indispensable for ensuring compatibility and security of applications in corporate scenarios. However, its limitations, such as the lack of support for mass configurations and the need for technical knowledge for advanced settings, should be considered.