Turn Android Phone into a Kiosk with ADB Device Owner (No Root)

17 min read Step‑by‑step guide to configure Android’s device‑owner mode with ADB, lock‑task mode and kiosk restrictions without rooting. October 01, 2026 08:00 How to Turn an Android Phone into a Kiosk Device Using ADB Device Owner (No Root)

Why Use Device‑Owner Kiosk Mode?

Many businesses, schools, or hobbyists need a single‑purpose Android device that runs only a specific app (or a small set of apps). Android’s device‑owner mode, combined with lock‑task (kiosk) APIs, lets you lock down the device without rooting or flashing a custom ROM. The result is a self‑contained, tamper‑resistant terminal that can be handed to anyone while keeping the underlying system safe.

What this tutorial covers: enabling device‑owner mode via ADB, configuring lock‑task mode, whitelisting apps, handling common pitfalls, and restoring the device to normal operation.

Before You Start

  • Device requirements: Android 6.0 (Marshmallow) or newer. Most modern phones and tablets support the needed APIs.
  • Computer setup: A Windows, macOS, or Linux PC with adb installed. You can get the platform‑tools zip from the Android developer site and add it to your PATH.
  • USB debugging: Enable Developer options → USB debugging on the phone.
  • Battery charge: Keep the device above 50 % or plug it in. The process involves a reboot that could fail if power runs out.
  • Backup: The steps do not erase user data, but a full backup (via adb backup or your preferred method) is recommended in case you need to revert.

Step 1 – Prepare a Kiosk‑Ready App

Android’s lock‑task mode can only be started by an app that has been granted the appropriate permission. You have two options:

  1. Use an existing app that already declares android:lockTaskMode="if_whitelisted" in its manifest (e.g., many digital signage or POS apps).
  2. Build a simple placeholder if you just want a blank screen. The code is tiny and can be compiled with Android Studio.
    public class KioskActivity extends Activity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            // Hide system UI
            getWindow().getDecorView().setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
                View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
                View.SYSTEM_UI_FLAG_FULLSCREEN);
            // Start lock‑task mode
            startLockTask();
        }
    }

    Make sure the manifest contains:

    <activity android:name=".KioskActivity"
            android:lockTaskMode="if_whitelisted" />

For the purpose of this guide we will assume you have an APK called com.example.kiosk.apk ready to install.

Step 2 – Install the App via ADB

  1. Connect the phone to your PC with a USB cable.
  2. Open a terminal (or Command Prompt) and verify the connection:
    adb devices

    You should see a device ID with the word device next to it.

  3. Install the APK:
    adb install -r com.example.kiosk.apk

    The -r flag replaces any existing version.

If the installation fails with INSTALL_FAILED_INSUFFICIENT_STORAGE, clear some space or move media to an SD card before proceeding.

Step 3 – Set the App as Device Owner

Only the device‑owner can enable lock‑task mode without user interaction. The Android system provides a special ADB command for this purpose. Important: The device must be in a factory‑reset state for the command to succeed. However, Android 9 (API 28) introduced a “test‑only” flag that works on a non‑reset device, which we will use.

  1. Identify the package name of the kiosk app (e.g., com.example.kiosk).
  2. Run the following command:
    adb shell dpm set-device-owner com.example.kiosk/.MyDeviceAdminReceiver

    Here .MyDeviceAdminReceiver is a broadcast receiver declared in the app’s manifest as a device_admin component. If you used the simple placeholder app, add this receiver:

    <receiver android:name=".MyDeviceAdminReceiver"
            android:permission="android.permission.BIND_DEVICE_ADMIN">
            <meta-data android:name="android.app.device_admin"
                android:resource="@xml/device_admin_receiver" />
            <intent-filter>
                <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
            </intent-filter>
        </receiver>
  3. If the command returns Success: Device owner set, you are ready. If you receive Failure: Not allowed to set device owner, you have two options:
    • Factory‑reset the device and run the command immediately after the first boot (before any user interaction).
    • Use the --user 0 flag on Android 9+ with a test‑only build, but this is less reliable across manufacturers.

Running adb shell dumpsys device_policy after setting the owner lets you verify that the package appears under “Device owner package”.

Step 4 – Whitelist the Kiosk App for Lock‑Task

Even as device owner, Android will only allow lock‑task for apps that are explicitly whitelisted.

  1. Execute the whitelist command:
    adb shell dpm set-lock-task-packages com.example.kiosk com.example.kiosk

    Replace the second argument with a space‑separated list if you need multiple apps.

  2. Confirm the list:
    adb shell dpm get-lock-task-packages com.example.kiosk

    You should see your package name echoed back.

Step 5 – Launch the Kiosk App in Lock‑Task Mode

Now that the system trusts the app, you can start it and it will automatically enter lock‑task.

  1. Start the app via ADB (useful for testing):
    adb shell am start -n com.example.kiosk/.KioskActivity
  2. Observe the UI:
    • The status bar, navigation buttons, and recent‑apps button disappear.
    • Attempting to press the home button will have no effect; Android stays in the app.

If the device still shows system UI, double‑check that the activity’s android:lockTaskMode attribute is set to if_whitelisted and that the package is correctly whitelisted.

Step 6 – Fine‑Tune Kiosk Restrictions

Device‑owner APIs expose many policies you can enforce, such as disabling the status bar, blocking USB debugging, or enforcing a password. Below are a few useful calls you can run via adb shell (they affect the whole device):

  • Disable the status bar (prevents pull‑down notifications):
    adb shell settings put global policy_control immersive.full=*
  • Enforce a simple PIN (replace 1234 with your choice):
    adb shell dpm set-password-complexity 0
    adb shell dpm set-keyguard-enabled true
    adb shell dpm set-keyguard-disabled false
    adb shell locksettings set-pin 1234
  • Block USB file transfer (useful for public kiosks):
    adb shell dpm set-permission-grant-state com.example.kiosk android.permission.READ_EXTERNAL_STORAGE granted

    Then disable the USB data mode via Settings > Connected devices > USB > No data transfer.

All of these commands can be scripted in a shell file on the device (using Termux) or on your PC for repeatable deployments.

Step 7 – Provide a Secure Exit Path (Optional)

In a pure kiosk you may never want users to leave the app, but administrators sometimes need an emergency exit.

  1. Define a secret Intent that the app listens for, e.g., com.example.kiosk.EXIT_KIOSK.
  2. From a trusted PC, trigger it with:
    adb shell am broadcast -a com.example.kiosk.EXIT_KIOSK

    The app should call stopLockTask() and finish its activity, returning the user to the home screen.

If you cannot modify the app source, you can still break out of lock‑task by issuing a forced stop:

adb shell am force-stop com.example.kiosk

Use this only when you have physical access to the device.

Troubleshooting Common Issues

Device Owner Command Fails

  • Symptom: Failure: Not allowed to set device owner.
  • Cause: The device has already been set up for a regular user, or a previous device owner exists.
  • Fix:
    1. Factory reset the device (Settings > System > Reset > Factory data reset).
    2. Immediately after the device restarts and shows the “Welcome” screen, connect via ADB (you may need to enable USB debugging in the setup wizard – tap the screen seven times on the build number to reveal Developer options).
    3. Run the dpm set-device-owner command before completing the setup.

Lock‑Task Does Not Engage

  • Symptom: Home or back button still works after launching the app.
  • Cause: The app is not whitelisted, or the activity’s manifest flag is missing/incorrect.
  • Fix:
    1. Confirm the whitelist with dpm get-lock-task-packages.
    2. Open the APK (using apktool) and verify the android:lockTaskMode attribute.
    3. Re‑install the corrected APK and repeat Step 5.

System UI Still Visible

  • Symptom: The status bar can be pulled down, revealing notifications.
  • Cause: Immersive mode not enforced or manufacturer overlay resets UI flags.
  • Fix:
    1. In the activity’s onCreate, call setSystemUiVisibility with the flags shown in Step 1.
    2. For Samsung or OnePlus devices, add the global setting:
      adb shell settings put global policy_control immersive.full=*

Battery Drain After Kiosk Activation

  • Symptom: Battery depletes faster than expected.
  • Cause: The device stays awake because lock‑task prevents the system from sleeping.
  • Solution:
    1. Enable a wake‑lock timeout in the app (e.g., PowerManager.WakeLock with a short timeout).
    2. Reduce screen brightness via adb shell settings put system screen_brightness 30.

Restoring the Device to Normal Use

If you later decide the device should no longer be a kiosk, follow these steps:

  1. Remove the device owner:
    adb shell dpm remove-active-admin com.example.kiosk/.MyDeviceAdminReceiver
  2. Clear the lock‑task whitelist:
    adb shell dpm set-lock-task-packages com.example.kiosk

    Notice the command ends with no package list, which clears the whitelist.

  3. Uninstall the kiosk app (optional):
    adb uninstall com.example.kiosk
  4. Reboot the device to ensure all policies are cleared:
    adb reboot

After reboot, the device behaves like a regular Android phone.

Best Practices for Production Deployments

  • Use a dedicated admin app that bundles the device‑owner receiver, the kiosk activity, and any remote‑management logic.
  • Version control: Keep a signed APK version that matches the device‑owner package name; changing the package breaks the ownership.
  • Secure ADB access: Once the kiosk is live, disable USB debugging (Settings > Developer options). If you need remote updates, use adb over Wi‑Fi with a strong password on the network.
  • Physical security: Store the device in a locked enclosure and consider disabling the power button long‑press (via a custom ROM or hardware switch) to prevent a factory reset.

Conclusion

By leveraging Android’s built‑in device‑owner and lock‑task APIs you can turn any compatible phone or tablet into a robust kiosk without rooting, flashing, or installing third‑party launchers. The steps above give you a repeatable workflow: prepare a kiosk‑ready app, install it, set the device owner, whitelist the app, and fine‑tune restrictions. Troubleshooting tips help you recover from common hiccups, and the restoration procedure ensures you can revert the device if the kiosk purpose ends. With careful planning and the safety measures outlined, you’ll have a secure, single‑purpose Android terminal ready for signage, point‑of‑sale, education, or any scenario that demands a locked‑down UI.

User Comments (0)

Add Comment
We'll never share your email with anyone else.