v2.80 · 1 Sep 2026
The enterprise (_ent) versions of DroidScript enable certain extra admin features which are banned for apps published to Google Play but are useful for private/commercial projects where APKs are expected to be 'side loaded'. For example full COSU (kiosk mode) and SMS interception are enabled in the enterprise versions.
Note: The Enterprise version will not build AABs, which are required for Google Play.
In Kiosk mode users will not be able to get to the Android System menus or escape your app unless you let them. This is ideal for information kiosks, machine controllers or POS systems. It can be used on Android Tablets, Phones and TV boxes.
Once you have installed your app this way you will have to FACTORY RESET to remove the app.
You can ONLY update your app if it has the same package name and is signed with the same key.
You may not be able to access the top pull down menus on Android when you need them, so either make sure you have a home screen icon available to launch the Android settings before enabling KIOSK mode, or add code to your app to access the settings via a secret click area or pin dialog that calls this line of code:
app.SendIntent( null, null, "android.settings.SETTINGS" )
Add the following code to your OnStart function:
app.SetKioskMode( "LockTask", true, "", app.GetPackageName() )
Build an APK using the _ent version of the ApkBuilder.
Connect to the device from a PC via ADB using a USB cable (or via ADB-WiFi). See these instructions.
Check that the ADB drivers are installed properly by typing the following (you should see your device listed):
adb devices
Run the following command (change com.mycompany.myapp to match your app package name):
adb shell dpm set-device-owner com.mycompany.myapp/com.smartphoneremote.ioioscript.DeviceAdminReceiver
Run your App and accept all the permission requests. Your App is now a device Administrator and cannot be escaped from or removed by the user without a factory reset!
You can control what users are allowed to do when kiosk mode is enabled by using various options when calling the app.SetKioskMode method. For example you can allow certain apps to be started by including a comma separated list of their package names in the last parameter like this:
app.SetKioskMode( "LockTask", true, "",
app.GetPackageName()+",com.android.tv.settings,com.android.settings,com.android.bluetooth" )
In the above case, we want to allow users to interact with the bluetooth pairing dialogs when our app initiates a pairing request. However they still cannot get to the Android settings menu by swiping down from the top of the screen or pressing the back button to get to the home screen.
By default the device will be fully locked down, however you can allow certain actions by including keywords in the 3rd parameter, for example to allow access to an external USB stick do the following:
app.SetKioskMode( "LockTask", true, "physicalmedia", app.GetPackageName() )
These are the keywords available in the 'options' parameter:
boot - set this activity so that its always started on boot.allowupdates - allow the system to be updated (by Google).allowsleep - allow the screen to dim/sleep when plugged in.power - enable the power button long-press actions.home - enable the home button.notifications - enable notification to be shown.overview - enable the recent task list overview.info - enable the system info area in the status bar.keyguard - enable the keyguard.safeboot - enable safeboot mode.factoryreset - enable factory reset from settings.adduser - enable adding of a new user from settings.physicalmedia - enable use of external usb storage devices.You can disable KioskMode using the following code, however the app will exit immediately after the call.
app.SetKioskMode( "LockTask", false, "", app.GetPackageName() );
If you just call app.Exit() then some of the kiosk mode restrictions may stay in place, such as blocking of the status bar. It's a good idea to provide a secret button or option for exiting your app, maybe protected with a pin-code, so that admins/engineers can exit the app when needed.
Without an exit feature, you may have difficulty stopping the app to configure Android during development or maintenance, it may become necessary to re-power the device to exit the app, but if you have enabled the boot option, or call app.SetAutoBoot in your code, you could get into a situation where you can't get out of the app as it keeps starting automatically!
However most operations can still be achieved via ADB, especially if the device is rooted (many industrial Android devices are rooted by default). For example you can get a super user shell, list processes (to find the process id of your app) and kill the process using the following commands:
adb shell
su
ps -e
kill 12345
Many useful operations can be done via ADB with Android 'pm' package manager and 'am' commands too:
When setting up large numbers of kiosk devices in a production scenario, it may be useful to create Linux shell scripts or Windows batch files that can fully configure a fresh device for you via a USB cable. This can be done using a sequence of the adb commands, such as the 'push' command to copy files to the device, the 'install' command to install your packages, as well as 'dpm' and 'pm' commands to manage/remove/modify factory installed packages.
Finally, ChatGPT, Claud or Gemini can be very helpful when building ADB shell scripts!