Script Commands for Android Classic Devices

Use the options and examples below to help you create powerful script commands.

Note: Not all script commands are compatible with all devices within a platform. The table entries note the limitations.
Tip: You can also use JavaScript to create and send scripts to your Android Plus devices. See Android Plus JavaScript Scripts for details.

Legend

Format Meaning
text Enter the command exactly as shown.
text Replace with the requested information.
[text] Information contained within square brackets is optional to the command.
text|text Choose one of the options separated by the vertical pipe.

Commands

Command Syntax
abortpkg

Halts the installation of a package and forces the installation status in the SOTI MobiControl console to report "Failed" when used in a SOTI MobiControl pre-install script.

See Using Package Studio for more information.

abortpkg
agent_mode

Retrieves the current agent mode (user or administrator) of a device with lockdown mode applied and displays it in the Logs section of the Device Information panel.

agent_mode
appcontrol

Applies blacklist rules. This command supports a limited set of parameters.

appcontrol [-s|-b|-w] containerID

Where:

  • -s clears application run control rules
  • -b adds an application to the blacklist
  • -w adds an application to the whitelist
  • containerID is the ID of the application

Example

To add the Facebook app to the blacklist:

appcontrol -b com.facebook.appmanager

app_upgrade disable <package-list>

Enables the administrator to disable automatic Android Enterprise agent updates to the latest versions from the Google Play Store remotely on Android devices through SOTI MobiControl.

Minimum device agent version: 15.1.5

Android OS:

Samsung: API Level 11 and MDM v 5.0+ and above

Zebra: API Level 26 and MXMF v10.3 and above

OEMs supported: Samsung and Zebra

app_upgrade disable <package-list>

Example

app_upgrade disable com.businessapp

app_upgrade enable <package-list>

Enables the administrator to enable automatic Android Enterprise agent updates to the latest versions from the Google Play Store remotely on Android devices through SOTI MobiControl.

Minimum device agent version: 15.1.5

Android OS:

Samsung: API Level 11 and MDM v 5.0+ and above

Zebra: API Level 26 and MXMF v10.3 and above

OEMs supported: Samsung and Zebra

app_upgrade enable <package-list>

Example

app_upgrade disable com.businessapp

Note: You can skip <package-list> for Samsung devices.
batteryoptimize

Specifies if an application should adhere to the battery optimization restrictions.

Note: Supported on Samsung Android devices with Samsung MDM 5.7 or later. Enrolled with either a 13.6 Samsung ELM agent or a 13.6 Android Enterprise with a Samsung ELM license-enabled agent.
batteryoptimize allow | disable package

Example

To add an application to the Battery Optimization whitelist (the app ignores battery optimization restrictions):

batteryoptimize disable com.microsoft.office.outlook

To remove an application from the Battery Optimization whitelist (the app follows battery optimization restrictions):

batteryoptimize allow com.microsoft.office.outlook

certdelete

Deletes a certificate on the device.

Note: You can only use certdelete to remove certificates installed by SOTI MobiControl unless the device has a Samsung ELM agent installed. In this case, certdelete removes any specified certificates.
certdelete -issuer "IssuerName" -sn "SerialNumber" -storage "storage"

Where:

  • IssuerName is the common name of the certificate issuer
  • SerialNumber is the serial number of the certificate
  • storage is the type of storage into which to import the certificate

Example

To delete a certificate issued by apache.org:

certdelete -issuer "*.apache.org" -sn 00A03DB42A7841AFF5

certimport

Imports a user-specified certificate of X.509 type, which could be either DER or Base64 encoded.

certimport -cert "filepath" -ctype certificate_type -pwd "password" -itype "install_type" -storage "storage_type"

Where:

  • filepath is the relative or absolute path of the certificate (.cer) file to import
  • certificate_type is either CERT or PKCS12
  • -pwd "password" -itype "install_type" -storage "storage_type" are optional arguments and do not need to be included in the script
  • "password" is a string with the pfx password
  • "install_type" is either silent (default) or ui
  • storage is the storage location into which to import the certificate. MY, the only supported alternative option, installs the certificate in a keystore only usable from SOTI MobiControl. We recommend you omit the -storage argument.

Example

To import a certificate test.cer into current user storage:

certimport -cert "test.cer" -ctype CERT

clearappcache

Clears the cache memory of the specified application.

Devices supported: Supported on Android Classic and Work Managed devices.
Note:
  • For Android Work Managed devices, this script only supports the devices that SOTI MDM plugins supports. Visit the following website to see the supported MDM plugins - https://docs.soti.net/mobicontrolagentdownloads.
  • Samsung devices do not support this script.

Minimum Android agent version: 15.3.3

clearappcache packageName

Example

To clear the cache memory of the Business App application:

clearappcache com.businessapp
connect

Prompts the device agent to try to connect to the deployment server.

connect [-f]

Where -f forces the device agent to connect regardless of configuration or setup settings.

Example

To connect to the deployment server regardless of configuration or setup settings:

connect -f

copy

Copies one or more files to another location.

On Windows Mobile/CE and Desktop Classic devices, you can copy files between desktop computers and mobile devices.

On Android devices, you can only copy files locally.

copy source destination

Example

To copy all files with the extension .txt from the C:\ to the temp directory on the device:

C:\tempt\*.txt 1:\temp

del

Deletes one or more files.

del filename

Example

To delete example.txt in the current directory:

del example.txt

To delete all files with the extension .tmp in the current directory and its subfolders:

del *.tmp

devrename

Renames a device.

devrename newDeviceName

If the name has spaces, use quotation marks.

Example

To change the name of a device to Apricot Candy:

devrename "Apricot Candy"

disconnect

Disconnects the device from the SOTI MobiControl deployment server.

disconnect
elm_awaken

Adds or removes the Samsung ELM agent to/from the Android Doze Mode whitelist. Enables the agent to circumvent battery optimizations that limit connectivity between the agent and the deployment server.

Available on Samsung devices running Android 6.0 or later and Knox Standard SDK 5.7 or later.

elm_awaken 0|1

Example

To add the ELM agent to the whitelist:

elm_awaken 1

To remove the ELM agent from the whitelist:

elm_awaken 0

enable_system_app

Enables a system application on the device for use in the Android Enterprise container.

Note: This command is only for applications included in the device’s firmware.
enable_system_app appBundleID

Example

To add Google Chrome to the Android Enterprise container:

enable_system_app com.android.chrome

finishpkg

Finishes the current script without processing the rest of the package and reports package installation as successful to the deployment server. This is useful, particularly in packages that involve wiping a device. Use this script command to skip reinstalling the package but still report as successfully installed to the deployment server.

If a hard reset is initiated from a package's post-install script, the entire package reinstalls after the reset. Include a check in the pre-install script to determine whether the package's files are already installed.

Note: This command is not useful as a script command in and of itself but in the event of a package involving a cold boot.
"path\to\package"finishpkg

Example

"1:\PersistentStorage\subfolder" finishpkg

For platforms that support the if command, you use finishpkg conditionally: If a package's post-install script contains:

md "1:\PersistentStorage\subfolder"reset /w

then the pre-install script could contain a check to prevent the package from reinstalling endlessly:

if exist "1:\PersistentStorage\subfolder" finishpkg

foregroundmode

Switches the SOTI MobiControl service between foreground and background modes. While running in foreground, mode the SOTI MobiControl process receives high priority and is not killed by the system.

While the service is running in foreground mode, a SOTI MobiControl icon displays in the device's notification area.

foregroundmode enable|disable

Example

To enable foregroundmode

foreground enable

ftp

Copies a file or directory from an FTP server to a device.

ftp [wget] [-o,-r] source destination

Where:

  • wget copies a file from an FTP server to a local storage or SD card on the device
  • -o specifies to override existing files
  • -r specifies to recursively read all files under each folder

Example

To copy a file from FTP to local storage on the device:

ftp wget -o -r ftp://user:123@server/folder /storage/emulated/0/Download

httpget

Downloads files using the HTTP protocol.

httpget URL localPath
identify_activity

Identifies the current top activity on the device.

identify_activity
identify_package_certificate

Identifies the signature of a package and displays it in the device ADB logs.

identify_package_certificate packageName

Example

identify_package_certificate com.my.helloworld

ifconfig

Displays the configuration of the network interfaces on the SOTI MobiControl console.

ifconfig interfaceName

Where if no interfaceName is provided, then all is used as the default and lists all interfaces.

Use -i with all to display the interface names only.

Example

To list all interface names:

ifconfig all -i

To show the configuration of eth0 interface

ifconfig eth0

import_contacts_vcf

This feature enables the administrator to add Collation/Unicode in import_contacts_vcf scripts so that it maintains the proper character format of the .vcf file when you import it.

Minimum Agent: 15.2.4

Limitations/Constraints/Pre-requisites: This is a generic implementation. There is no OS or OEM limitation

import_contacts_vcf <filePath> 1/0 <charsetName>

Where:

  • 0 = Add contacts to existing contacts
  • 1 = Replace existing contacts with the new contacts of the .vcf file
  • charsetName = Character encoding in the .vcf file

Example

import_contacts_vcf "/storage/ contacts.vcf" 1 UTF-8

install

Installs an application on the device.

install appInstallerPath

Where appInstallerPath is the full path to the application installer file on the device

Example

To install the Gmail app located on an SD card:

install /sdcard/Download/Gmail.apk

install_system_update
Installs a system update from the specified file. This command supports the following OEMs:
  • Getac
  • Pointmobile
  • Zebra
  • Chainway
Note: Do not use this command on encrypted devices. Use the sendintent command instead.
install_system_update filename

Example

To install a system update from a file on an SD card:

install_system_update /sdcard/Download/et1.zip

Note: If /sdcard/Download does not work, use /storage/sdcard0/Download instead, as in:

install_system_update /storage/sdcard0/Download/et1.zip

installpackage

Installs a SOTI MobiControl package built using Package Studio.

Note: This command is not recursive and is only used through the console or an API call to install a previously sideloaded package. It is not intended for use within one package to install another package.
installpackage pathToPackage

Example

To install a package from the %tmp% folder:

installpackage %tmp%package1.pcg now

ipaddr

Lists the IP addresses of the device.

ipaddr
kill_application

Terminates a process that is currently running on the device.

Requires:

  • Android Classic
  • Android Enterprise (Agent 14.0.0)
kill_application packageName

Example

To terminate the Angry Birds game process on the device

kill_application com.rovio.angrybirds

list_volumes

Lists storage volume information of remote managed device. The results are displayed using a custom event on the console.

list_volumes
lock

Turns the device screen off and locks the device until the device user enters the correct password.

lock
lockdownorientation

Sets the orientation of the device screen while it is in lockdown or kiosk mode.

lockdownorientation orientation

Where orientation is either landscape or portrait

Note: Setting any parameter other than landscape or portrait causes the kiosk screen to default to landscape for Android Honeycomb (3.0) and later. It can also cause the kiosk screen to default to portrait for Android Gingerbread (2.3).

Example

To set the orientation of the lockdown screen to landscape:

lockdownorientation landscape

To set the orientation of the lockdown screen to portrait:

lockdownorientation portrait

log

Sends a custom message to the SOTI MobiControl deployment server from the device. This message appears in the Logs tab of the Device Information panel in the SOTI MobiControl console.

log type message

Where type is the type of the associated message, and the options are:

  • -e for Error
  • -w for Warning
  • -i for Information

Example

To send a notification to the SOTI MobiControl console at certain intervals during a software push:

Note: Put the command in the pre-install script

log -i "Starting Software Push"

malwarescan

Initiates a Webroot scan for malware on the device.

malwarescan
mkdir or md

Creates a new directory.

mkdir [drive:] path

Example

To create a directory named "test" from the current directory:

mkdir test

To create test\test1\test2\test3 recursively:

mkdir test \test1 \test2 \test3

mxconfig

Submits XML configuration instructions to the MX layer of the device.

Note: This script command is only applicable on Zebra Android devices. mxconfig uses the StageNow XML format (MXMS)
mxconfig xmlFilepath

Example

mxconfig /sdcard/Download/test.xml

mxxmlconfig

Executes an xml command from the inputPath and puts the result into the outputPath.

Note: This command is only supported on devices that support the older XML format (MX Legacy).
mxxmlconfig inputPath outputPath

Where

  • inputPath is the path to an XML file containing configuration settings for MX XML API.
  • outputPath is the path to a folder for the script execution result
notify kiosk

Enables or disables lockdown mode on the device.

notify kiosk on | off
notify

Sends a script that notifies other SOTI applications about data sync. You can use it to notify lockdown applications that lockdown view is synchronized.

Added in v9 to support re-enrolling a device on another SOTI MobiControl system

notify alias or notify package receiver

Where alias is a friendly name for the kiosk app.

Example

To notify kiosk about data sync:

notify kiosk or

notify net.soti.mobicontrol.lockdown net.soti.mobicontrol.lockdown.LockDownUpdateReceiver

promptpasswordchange

Prompts the user to change or set a password on their device by displaying a "Password Policy Pending" notification in the device agent.

promptpasswordchange
rem

Inserts a comment line in a script/batch file.

rem [comment]

Example

To add a comment about pumpkins:

rem The pumpkins are looking great this harvest

removemanagedinfo

Removes Samsung-managed information for specified applications.

Note: This command is only available on Samsung devices.
removemanagedinfo packageName
request_appops_permission

Sends a request to the device prompting the user to grant the specified permissions.

request_appops_permission permissionName where the permissionName can be one of:
  • SYSTEM_ALERT_WINDOW requests the Draw Over permission. Requires an Android Classic or Enterprise agent of 13.5.2 or later
  • PACKAGE_USAGE_STATS requests the Usage Access permission. Requires an Android Classic or Enterprise agent of 13.6.1 or later
  • BIND_NOTIFICATION_LISTENER_SERVICE requests the Notification Access permission. Requires an Android Classic or Enterprise agent of 13.6.1 or later.
  • WRITE_SETTINGS requests the Modify System Settings permission. Requires an Android Classic or Enterprise agent of 13.7.0 or later

Where possible, the permissions are granted silently.

request_appops_permission android.permission.SYSTEM_ALERT_WINDOW allow <Package_ID>
Note: This command is supported in Android Enterprise Work Managed, Android Classic, and in the external agent (that is, COPE Work Managed)
insideagent request_appops_permission android.permission.SYSTEM_ALERT_WINDOW allow <Package_ID>
Note: This command is supported in the internal agent (that is, COPE Work Profile).

Enables any third-party application (this applies to the SOTI MobiControl agent as well) to silently display over other applications across all Android devices.

Minimum Agent: 15.1.5

Plugin Versions: 1.15.1.102 (recommended for silent granting)

Devices supported: Android Enterprise with plugins (DO, COPE) and Android Classic devices

Android OS: 6 and later

OEMs Supported: Samsung, Zebra, Google, Honeywell (This feature is not OEM specific)

request_appops_permission android.permission.SYSTEM_ALERT_WINDOW allow <Package_ID>

insideagent request_appops_permission android.permission.SYSTEM_ALERT_WINDOW allow <Package_ID>

Example:

request_appops_permission android.permission.SYSTEM_ALERT_WINDOW allow com.businessapp

insideagent request_appops_permission android.permission.SYSTEM_ALERT_WINDOW allow com.businessapp

request_appops_permission android.permission.SYSTEM_ALERT_WINDOW disallow <Package_ID>
Note: This command is supported in Android Enterprise Work Managed, Android Classic, and in external agent (that is, COPE Work Managed)
insideagent request_appops_permission android.permission.SYSTEM_ALERT_WINDOW disallow <Package_ID>
Note: This command is supported in internal agent (that is, COPE Work Profile).

Disables the ability of any third-party application (this applies to the SOTI MobiControl agent as well) to silently display over other applications across all Android devices.

Minimum Agent: 15.1.5

Plugin Versions: 1.15.1.102 (recommended for silent granting)

Devices supported: Android Enterprise with plugins (DO, COPE) and Android Classic devices

Android OS: 6 and later

OEMs Supported: Samsung, Zebra, Google, Honeywell (This feature is not OEM specific)

request_appops_permission android.permission.SYSTEM_ALERT_WINDOW disallow <Package_ID>

insideagent request_appops_permission android.permission.SYSTEM_ALERT_WINDOW disallow <Package_ID>

Examples:

request_appops_permission android.permission.SYSTEM_ALERT_WINDOW disallow com.businessapp

insideagent request_appops_permission android.permission.SYSTEM_ALERT_WINDOW disallow com.businessapp

reset

Performs a soft or hard reset of the device.

reset [/s | /H | /W | /E] [/delaysec]

Where:

  • /s is the default option, and soft resets the device. This option terminates any desktop remote control sessions.
  • /H can hard reset a device running on the Windows Pocket PC or Windows CE platforms. It clears any data stored in the volatile memory. On Windows Mobile 5.0 and later devices, this is equivalent to a soft reset. The real-time clock may also reset depending on the device's make and model.
  • /W can wipe data stored on the device and reset the device to factory default settings.
    Note: The wipe command is only supported on the Windows Mobile 5 operating system with AKU2 or later and newer versions of Windows Mobile.
  • /E can wipe data stored on the device and its external storage and to reset the device to factory default settings.
  • /P can bypass factory reset protection. It is only supported on Android Enterprise Work Managed devices.

On Android Plus devices, it is possible to specify a /delay parameter (in seconds): reset /s /delay 10

If /delay parameter is not defined, the default value is 5 seconds.

Example

To soft reset a device:

reset /s

To reset an Android Plus device to its factory settings in 30 seconds:

reset /E /delay 30

resetpassword

Resets device password to a new password.

resetpassword newPassword

Example

To reset the current password to password12345

resetpassword password12345

resetwifiproxy

Clears proxy configuration settings for the specified SSID (which should exist on the device before sending the command).

Note: Supported on devices running Android 4.0 or later.
resetwifiproxy ssid

Example

To reset a proxy configuration for SSID 105:

resetwifiproxy 105

restartagent

Restarts the device agent.

restartagent

As of Android agent v14.3.1, the agent waits until it is idle before it restarts (generally less than 10 seconds). Add --immediately to restart the agent the moment you receice the script. Earlier versions of the agent restart immediately.

rmdir or rd

Deletes a directory.

rmdir [/S] path

Where /S removes any subdirectories

On Android Plus and Linux devices, this command requires the /S option and deletes the specified item, whether it is a directory or a file.

Example

To remove an empty directory named "test" from the current directory:

rmdir test

To remove a directory named "test" and all of its contents from the current directory:

rmdir /S test

To provide location:

rmdir /sdcard/Download/test

sendinfo net.soti.action.hub ENABLESCREENCAPTURE

Controls whether device users can take screen captures within the SOTI Hub app.

Note: If you disable screen capture, there may be a blank screen if you remote control a device and open a file in SOTI Hub.
sendinfo net.soti.action.hub ENABLESCREENCAPTURE 0 | 1

Where:

  • 0 blocks screen captures
  • 1 enables screen captures

Example

To block a device user from taking screenshots within the SOTI Hub app:

sendinfo net.soti.action.surf ENABLESCREENCAPTURE 0

sendinfo net.soti.action.surf BROWSERZOOMLEVEL

Sets the zoom level in the SOTI Surf app.

sendinfo net.soti.action.surf BROWSERZOOMLEVEL value

Where value is a percentage that represents the level of zoom.

Example

To set the zoom level of the SOTI Surf app to 400%:

sendinfo net.soti.action.surf BROWSERZOOMLEVEL 400

sendinfo net.soti.action.surf DISABLEBROWSERZOOMGESTURE

Controls whether device users can use gestures (like pinch to zoom) to magnify web pages opened in the SOTI Surf app.

sendinfo net.soti.action.surf DISABLEBROWSERZOOMGESTURE 0|1

Where:

  • 0 enables zoom gestures
  • 1 disables zoom gestures

Example

To disable zoom gestures in the SOTI Surf app:

sendinfo net.soti.action.surf DISABLEBROWSERZOOMGESTURE 1

sendinfo net.soti.action.surf DISABLEMEDIAAUTOPLAY

Turns on or off media autoplay and controls SOTI Surf access to the device camera.

sendinfo net.soti.action.surf DISABLEMEDIAAUTOPLAY 0 | 1

Where 0 turns on media autoplay and 1 turns off media autoplay.

Example

To turn on media autoplay and grant SOTI Surf access to the device camera:

sendinfo net.soti.action.surf DISABLEMEDIAAUTOPLAY 0

sendinfo net.soti.action.surf DISABLEPULLTOREFRESH

Controls whether device users can swipe downwards on their screen to refresh the current webpage in the SOTI Surf app.

sendinfo net.soti.action.surf DISABLEPULLTOREFRESH 0|1

Where:

  • 0 enables pull to refresh
  • 1 disables pull to refresh

Example

To disable the pull to refresh gesture in the SOTI Surf app:

sendinfo net.soti.action.surf DISABLEPULLTOREFRESH 1

sendinfo net.soti.action.surf ENABLETHIRDPARTYCOOKIES

Controls whether cookies from third-party domains (that is, domains beyond the site the user is visiting) are blocked on SOTI Surf.

sendinfo net.soti.action.surf ENABLETHIRDPARTYCOOKIES 0|1

Where:

  • 0 blocks third-party cookies
  • 1 enables third-party cookies

Example

To allow third-party cookies in the SOTI Surf app:

sendinfo net.soti.action.surf ENABLETHIRDPARTYCOOKIES 1

sendintent

Sends intent to devices.

See The sendintent Command for more information

sendreport

Sends a debug report from the device agent to the SOTI FTP server.

sendreport
setfirewallproxy

Sets proxy configuration on device level (iptables based).

Note: Supported on devices with Samsung MDM v2 and later only.
setfirewallproxy host port containerID

Example

setfirewallproxy 192.168.2.127 8080

set_configurable_kiosk_splash

This feature enables the administrator to suppress or change the SOTI agent logo while in kiosk mode.

Minimum Agent: 15.2.4, same as lockdown

Plugin Versions: Not required

Devices supported: Android Classic and Android Enterprise DO

Android OS: same as lockdown

set_configurable_kiosk_splash <0,1> <file path>

set_configurable_kiosk_splash <0,1>

Where:

  • 0 = Display SOTI MobiControl logo as it is.
  • 1 = Disable SOTI MobiControl logo and show nothing.
  • file path = the file path to fetch the desired logo

Examples

set_configurable_kiosk_splash 1

set_configurable_kiosk_splash 1 /storage/ image.png

Note: The script fails if you do not supply an argument.
setlocale

Sets the device's default locale.

Note: Supported on Motorola Android Plus devices with a signed agent only.
setlocale locale
setmobiledata

Enables or disables mobile data on a device.

Note: These settings may conflict with device feature control, and settings are non-restrictive and non-persistent.
setmobiledata 0|1

Where 0 disables mobile data and 1 enables mobile data.

Example

To disable mobile data:

setmobiledata 0

To enable mobile data

setmobiledata 1

setradioenable

Enables or disables WiFi, Bluetooth, or cellular networks for the device. If the phone radio is disabled, no audio and data telephony functionalities can occur. A phone reboot typically re-enables the radio.

Note: These settings may conflict with device feature control, and settings are non-restrictive and non-persistent.
setradioenable wifi|bt|phone 0|1

Where:

  • wifi is WiFi
  • bt is Bluetooth
  • phone is Cellular
  • 0 disables the radio
  • 1 enables the radio

Example

To disable Bluetooth radio

setradioenable bt 0

To enable WiFi

setradioenable wifi 1

setwifiproxy

Sets WiFi proxy settings using a provided host and port for the specified SSID. The access point ID should exist on the device before sending this command.

Note: Supported on devices running Android 4.0.
setwifiproxy ssid host port

Example

To set up a WiFi proxy:

setwifiproxy 105 192.168.2.127 8080

setwifipacurl

Sets WiFi proxy settings using a provided PAC file. The access point ID should exist on the device before sending this command.

Note: Supported on devices running Android 4.0.
setwifipacurl ssid PACfileURL

Example

To set up a WiFi proxy using a PAC file:

setwifipacurl 105 https://website.com/proxy.pac

showmessagebox

Displays a message box on the device screen.

Note: The Android Plus agent has the following limitations:
  • It does not support a complex showmessagebox that contains more than one command
  • It cannot return the user response
  • It does not support "if" and related keywords
showmessagebox message [timer] [type] [default button] [action]

Where:

  • message is the message displayed in the message box. Use quotation marks (" ") if there are spaces in the message.
  • [timer] is the number of seconds until the message box disappears automatically. If you omit a timer value or add the keyword NO_TIMER, the message box persists until the device user dismisses it.
  • [type] is type of message box. Options are:
    • 1 displays an information window with an OK button
    • 2 displays a question window with Yes and No buttons
    • 3 displays a warning window with an OK button
    • 4 displays a question window with OK and Cancel buttons
    • 5 displays an error window with an OK button
  • [default button] sets the default buttons for message box types 2 (YES | NO) or 4 (OK | CANCEL)
  • NOTIFY_DEVICE notifies the device user of the message, depending on the notification settings applied to the device. Devices can be set to ring, vibrate, or muted to have no notification. Only Android Plus devices with agents 14.0.0 or later are supported.

The return values for the showmessagebox are stored in a global variable, ShowMessageBoxReturn Use this variable in scripts as %ShowMessageBoxReturn% to execute actions based on user response. Possible return values are IDYES, IDNO, IDOK, IDCANCEL. The value for this global variable does not change if the type is not 2 or 4.

Example

To show a simple message:

showmessagebox "This is a test message"

To provide device information using a macro:

showmessagebox "Your device's IP address is %IP%"

To set a 3-second timer to your message:

showmessagebox "This is a test message with a 3-second timer" 3

To add YES and NO buttons to your message box with no timer

showmessagebox "This is a test message with Yes/No button and no timer" NO_TIMER 2

To provide follow-up actions to a user's response to a message box:

showmessagebox "Abort the operation?" NO_TIMER 2 YES
if %ShowMessageBoxReturn% == IDYES goto Exit
sleep

Initiates sleep mode on the device for a set period. Only use this command in scripts.

sleep [length]

Where length is in seconds

Example

To set the device to sleep for 5 seconds:

sleep 5

sleepex

Initiates sleep mode on the device for a set period. Only use this command in scripts.

sleep [length]

Where length is in milliseconds

Example

To set the device to sleep for 3.5 seconds:

sleep 3500

start

Starts a program on the device. When the /wait option is specified, the script processor waits for the initiated program to terminate before executing the next command in the script.

start [/wait] program
Note: On Windows devices, program must be enclosed in quotation marks.

Example

To start Pocket Word and wait until it is terminated:

start /wait "\software\apps\pword.exe"

turnoff

Turns off the device.

turnoff [delay]

Where delay is a time in seconds.

Example

To turn off the device:

turnoff

To turn off the device in 25 seconds:

turnoff 25

uninstall

Removes the specified program from the device.

uninstall program [force]

Where:

  • program is the program ID for the program you want to uninstall
  • force forces uninstallation of the program, even if it is a system application

Example

To remove the program Google Maps:

uninstall com.google.maps

uninstall_agent

Removes the agent from the device and clears any previously applied policies. This process can take up to 30 seconds.

Note: This command cannot uninstall a Samsung ELM agent due to permission limitations. Additionally, some feature modules do not handle wipe/rollback properly and can hamper a clean uninstall.
uninstall_agent
unlock

Unlocks the device and dismisses the password lock screen.

unlock
updatedefinitions

Prompts Webroot to update its malware definitions.

updatedefinitions
wifiapenable

Enables or disables a WiFi mobile access point.

Note: Supported on devices running Android 4.0 to 8.0.
wifiapenable 0|1

Where 0 disables WiFi and 1 enables WiFi

Example

To disable WiFi:

wifiapenable 0

wifireconnect

Forces the device to drop a WiFi connection and reconnect.

Note: Supported on devices running Android 4.0 or later with Android Plus capabilities.
wifireconnect
wipeapplication

Wipes application data for the specified application from the device.

wipeapplication packageName
writeprivateprofstring

Saves or deletes specified settings on a device.

See The writeprivateprofstring Command for more information.

writesecureprofstring

This command has the same functionality as writeprivateprofstring except, the data being written are not logged.

See The writeprivateprofstring Command for more information.