Walkthrough - Android 15 (API 35) Work Profile Setup & Run
This developer guide provides step-by-step instructions on how to set up an Android 15 Work Profile (Managed Profile) on an emulator using command-line tools (adb), install the NTP DIG PING MORE application inside the work profile, and run/debug it.
This is highly useful for verifying MDM (Mobile Device Management) scenarios, Managed Configurations, and profile separation behaviors in a BYOD (Bring Your Own Device) environment.
Prerequisites
Before starting, ensure that:
- You have the Android SDK installed and
adbis available in your shell'sPATH. - An Android Emulator (preferably running Android 15) is booted and connected to ADB.
- You have the Test DPC APK (
testdpc.apk) and the project's debug APK (app-debug.apk) available locally.
Step 1: Launch and Reset the Emulator
To ensure a clean environment without any conflicting user accounts, it is recommended to start the emulator with wiped user data:
emulator -avd AVD_NAME -wipe-dataEnsure the emulator is fully booted by verifying:
adb devices
# Output should show: emulator-5554 device
adb shell getprop sys.boot_completed
# Output should be: 1Step 2: Create a Work Profile via CLI
To create a managed work profile associated with the primary user (User 0), execute the following command:
adb shell pm create-user --profileOf 0 --user-type android.os.usertype.profile.MANAGED "Work Profile"Expected Output
Success: created user id 10[!NOTE] The created user ID (typically
10or higher) will be referred to asUSER_IDin all subsequent commands.
Start the newly created profile user:
adb shell am start-user USER_IDStep 3: Setup Test DPC as the Profile Owner
Test DPC is an enterprise utility used to simulate device policy constraints.
-
Install Test DPC to the managed profile user:
adb install --user USER_ID testdpc.apk -
Register Test DPC as the official Profile Owner of the work profile:
adb shell dpm set-profile-owner --user USER_ID com.afwsamples.testdpc/.DeviceAdminReceiver
Expected Output
Success: Active admin and profile owner set to com.afwsamples.testdpc/.DeviceAdminReceiver for user 10Step 4: Install the Application in the Work Profile
Install the project's debug APK inside the work profile using the --user flag:
adb install --user USER_ID ./app/build/outputs/apk/debug/app-debug.apkExpected Output
Performing Streamed Install
SuccessStep 5: Launch the Application in the Work Profile
Launch the NTP DIG PING MORE application launcher activity targeting the work profile user:
adb shell am start --user USER_ID -n io.github.mobilutils.ntp_dig_ping_more/.MainActivityExpected Output
Starting: Intent ( cmp=io.github.mobilutils.ntp_dig_ping_more/.MainActivity )In the emulator screen, you should now see the application open with a small briefcase badge on the bottom right of its launcher icon and task switcher bar, confirming that it is successfully running inside the secure Work Profile partition!
Useful Verification Commands
List Active User Profiles
To list all active user profiles on the device:
adb shell pm list usersExpected output shows User 0 (Primary) and User 10 (Work Profile).
List Installed Packages for the Work Profile
To list packages specifically installed inside the work profile:
adb shell pm list packages --user USER_ID | grep mobilutilsRemove/Clean up the Work Profile
To delete the work profile and completely reset:
adb shell pm remove-user USER_IDSummary of command used to setup and run the app inside the Work Profile on Android 15
Tracking Android execution and ADB commands for Work Profile setup on Android 15.
| Timestamp | Command | Observation/Result |
|---|---|---|
| 2026-05-24 21:49:53 | adb devices | Failed: ADB daemon not running on host port 5037 and socket bind blocked by sandbox |
| 2026-05-24 21:54:02 | emulator -avd Medium_Phone_API_35 -wipe-data | Successfully launched emulator in background with wiped data |
| 2026-05-24 21:54:07 | adb devices | emulator-5554 offline |
| 2026-05-24 21:54:12 | adb devices | emulator-5554 device |
| 2026-05-24 21:54:13 | adb shell getprop sys.boot_completed | Empty (booting in progress...) |
| 2026-05-24 21:54:30 | adb shell getprop sys.boot_completed | 1 (boot completed successfully) |
| 2026-05-24 21:54:40 | adb shell pm create-user --profileOf 0 --user-type android.os.usertype.profile.MANAGED "Work Profile" | Success: created user id 10 |
| 2026-05-24 21:54:47 | adb shell am start-user 10 | Success: user started |
| 2026-05-24 21:54:52 | adb install --user 10 testdpc.apk | Success |
| 2026-05-24 21:55:00 | adb shell dpm set-profile-owner --user 10 com.afwsamples.testdpc/.DeviceAdminReceiver | Success: Active admin and profile owner set |
| 2026-05-24 21:55:06 | adb install --user 10 app/build/outputs/apk/debug/app-debug.apk | Success |
| 2026-05-24 21:55:15 | adb shell am start --user 10 -n io.github.mobilutils.ntp_dig_ping_more/.MainActivity | Starting: Intent ( cmp=io.github.mobilutils.ntp_dig_ping_more/.MainActivity ) |
| 2026-05-24 21:55:21 | adb shell screencap -p /sdcard/workprofile_launch.png | Successfully captured screen of running Work Profile app |
Validation Results
We verified that:
- The profile user was created successfully with ID
10. - Test DPC was set as the profile owner.
- The NTP DIG PING MORE app (
io.github.mobilutils.ntp_dig_ping_more) was successfully installed inside user10profile. - The app successfully launched under the profile user
10.
Here is the captured emulator screenshot verifying that the NTP DIG PING MORE app successfully launched inside the Work Profile partition:
| User Profile | Work Profile |
|---|---|
![]() | ![]() |
![]() |


