Script Commands for Android Classic Devices
Use the options and examples below to help you create your own powerful script commands.
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
Example To add the Facebook app to the blacklist:
|
app_upgrade disable <package-list> Allows the administrator to disable automatic Android Enterprise agent updates to latest versions from the Google Play Store, remotely on Android devices through 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 enable <package-list> Allows the administrator to enable automatic Android Enterprise agent updates to latest versions from the Google Play Store, remotely on Android devices through 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
Note: <package-list>
can be skipped 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, that are enrolled with either a 13.6 Samsung ELM agent or a 13.6 Android Enterprise with Samsung ELM license enabled agent.
|
batteryoptimize allow | disable package
Example To add an application to the Battery Optimization whitelist (app will ignore battery optimization restrictions):
To remove an application from the Battery Optimization whitelist (app will follow battery optimization restrictions):
|
certdelete
Deletes a certificate on the device. Note: You can only use
certdelete to remove certificates that were installed by SOTI MobiControl unless the device has a Samsung ELM agent installed, in which case certdelete will remove any specified certificates. |
certdelete -issuer "IssuerName" -sn "SerialNumber" -storage "storage"
Where
Example To delete a certificate issued by apache.org:
|
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
Example To import a certificate test.cer into current user storage:
|
connect
Prompts the device agent to attempt to connect to the deployment server. |
connect [-f]
Where Example To connect to the deployment server regardless of configuration or setup settings:
|
copy
Copies one or more files to another location. On Windows Mobile/CE and Desktop Classic devices, files can be copied between desktop computers and mobile devices. On Android devices, files can only be copied 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:
To delete all files with the extension .tmp in the current directory and its subfolders:
|
devrename
Renames a device. |
devrename newDeviceName
If the name contains spaces, use quotation marks Example To change the name of a device to Apricot Candy:
|
disconnect
Disconnects the device from the SOTI MobiControl deployment server. |
disconnect
|
elm_awaken
Adds or removes the Samsung ELM agent to/from Android Doze Mode whitelist, enabling 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 ELM agent to whitelist:
To remove ELM agent from whitelist:
|
enable_system_app
Allows a system application on the device to be used in the Android Enterprise container. Note: Only applications that are included in the device's firmware can be used in this command.
|
enable_system_app appBundleID
Example To add Google Chrome to the Android Enterprise container:
|
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. This script command can be used to skip reinstalling the package but still report back as successfully installed to the deployment server. If a hard reset is initiated from a package's post-install script, the entire package will reinstall after the reset. A check can be included in the pre-install script that determines whether the package's files have already been installed. Note: This command is not useful as a script command in and of itself but in the event of a package that involves a cold boot.
|
"path\to\package"finishpkg
Example
For platforms that support the
then the pre-install script could contain a check to prevent the package from being reinstalled endlessly:
|
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 is displayed in the notification area of the device. |
foregroundmode enable|disable
Example To enable
|
ftp
Copies a file or directory from an ftp server. |
ftp [get|mget|wget] [-r,-o] source destination
Where
Example To copy a file from ftp to Download folder on the device:
To copy a folder from the device to ftp server:
|
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
|
ifconfig
Displays the configuration of the network interfaces on the SOTI MobiControl console. |
ifconfig interfaceName
Where if no interfaceName is provided, then Use Example To list all interface names:
To show the configuration of eth0 interface
|
import_contacts_vcf
Imports contacts to SOTI MobiControl through a VCF. |
import_contacts_vcf VCFfilePath 0|1
Where VCFfilePath is the location of the VCF to import. Selecting either 0|1 determines whether contacts are added to or replace the existing list:
|
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 in a Download folder:
|
install_system_update
Installs a system update from the specified file. This command is
supported for the following OEMs:
Note: This command cannot be used on encrypted devices. Use the
sendintent command instead. |
install_system_update filename
Example To install a system update from a file in the Download folder:
Note: If
/sdcard/Download does not work, use
/storage/sdcard0/Download instead, as
in:
|
installpackage
Installs a SOTI MobiControl package built using Package Studio. Note: This command is not recursive and can only be 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:
|
ipaddr
Lists the IP addresses of the device. |
ipaddr
|
kill_application
Terminates a process that is currently running on the device. Requires
|
kill_application packageName
Example To terminate the Angry Birds game process on the device
|
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 device until device user enters the correct password. |
lock
|
lockdownorientation
Sets the orientation of the device screen while its in lockdown or kiosk mode. |
lockdownorientation orientation
Where orientation is either Note: Setting any parameter other than landscape or portrait causes the kiosk screen to default to landscape for Android Honeycomb (3.0) and later, and to portrait for Android Gingerbread (2.3).
Example To set the orientation of the lockdown screen to landscape:
To set the orientation of the lockdown screen to portrait:
|
log
Sends a customs 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
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
|
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:
To create
|
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
|
mxxmlconfig
Executes an xml command from the Note: This command is only supported on devices that support the older XML format (MX Legacy).
|
mxxmlconfig inputPath outputPath
Where
|
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 synchronized. Added in v9 to support re-enrolling a device on another SOTI MobiControl system |
notify alias or notify package receiver
Where Example To notify kiosk about data sync:
|
promptpasswordchange
Prompts 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:
|
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 device user to grant the specified permissions. |
request_appops_permission permissionName where the permissionName can be one of:
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 external
agent (i.e. COPE Work Managed) insideagent
request_appops_permission android.permission.SYSTEM_ALERT_WINDOW
allow <Package_ID> Note: This command is supported in
internal agent (i.e. COPE Work Profile). Enables the ability to silently allow any third-party application (this applies to the SOTI MobiControl agent as well) to 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) |
Example:
|
request_appops_permission
android.permission.SYSTEM_ALERT_WINDOW disallow
<Package_ID> Note: This command is supported in
Android Enterprise Work Managed, Android Classic, and external
agent (i.e. COPE Work Managed) insideagent
request_appops_permission android.permission.SYSTEM_ALERT_WINDOW
disallow <Package_ID> Note: This command is supported
in internal agent (i.e. COPE Work Profile). Disables the ability to silently allow any third-party application (this applies to the SOTI MobiControl agent as well) to 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) |
Examples:
|
reset
Performs a soft or hard reset of the device. |
reset [/S | /W | /E | /P]
[/delaysec]
Where
On Android Plus devices it is possible to specify a
If Example To soft reset a device:
To reset an Android Plus device to its factory settings in 30 seconds:
|
resetpassword
Resets device password to new password. |
resetpassword newPassword
Example To reset current password to 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:
|
restartagent
Restarts the device agent. |
restartagent
As of Android agent v14.3.1, the agent waits until it's idle before it restarts (generally less than 10 seconds). Add |
ring_device
Commands the device to ring or vibrate, if possible. |
ring_device [volume] [time] [isVibrate]
volume sets the volume the device rings at. It must be a value between 25-100. time sets the length of time the device rings for. isVibrate toggles whether the device vibrates as well. Accepted values:
|
rmdir or rd
Deletes a directory. |
rmdir [/S] path
Where On Android Plus and Linux devices, this command requires the
Example To remove an empty directory named "test" from the current directory:
To remove a directory named "test" and all of its contents from the current directory:
To provide location:
|
sendinfo net.soti.action.hub ENABLESCREENCAPTURE
Controls whether device users can take screen captures within the SOTI Hub app. Note: If screen capture is disabled, you may see a blank screen if you remote control a device and then open a file in SOTI Hub.
|
sendinfo net.soti.action.hub ENABLESCREENCAPTURE 0 | 1
Where
Example To block device user from taking screenshots within the SOTI Hub app:
|
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 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
Example To disable zoom gestures in the SOTI Surf app:
|
sendinfo net.soti.action.surf DISABLEMEDIAAUTOPLAY
Turns on or off media auto-play and controls SOTI Surf access to the device camera. |
sendinfo net.soti.action.surf DISABLEMEDIAAUTOPLAY 0 | 1
Where Example To turn on media auto-play and grant SOTI Surf access to the device camera:
|
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
Example To disable the pull to refresh gesture in the SOTI Surf app:
|
sendinfo net.soti.action.surf ENABLETHIRDPARTYCOOKIES
Controls whether cookies from third-party domains (that is, domains beyond the site the user is currently visiting) are blocked on SOTI Surf. |
sendinfo net.soti.action.surf ENABLETHIRDPARTYCOOKIES 0|1
Where
Example To allow third-party cookies in the SOTI Surf app:
|
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
|
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 Example To disable mobile data:
To enable mobile data
|
setradioenable
Enables or disables WiFi, Bluetooth, or cellular networks for the device. If the phone radio is disabled, no telephony functionalities in terms of both audio and data can occur. A phone reboot will typically re-enable the radio again. Note: These settings may conflict with device feature control, and settings are non-restrictive and non-persistent.
|
setradioenable wifi|bt|phone 0|1
Where
Example To disable Bluetooth radio
To enable WiFi
|
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:
|
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:
|
showmessagebox
Displays a message box on the device screen. Note: The Android Plus agent has the following limitations:
|
showmessagebox message [timer] [type] [default button] [action]
Where
The return values for the Example To show a simple message:
To provide device information using a macro:
To set a 3 second timer to your message:
To add YES and NO buttons to your message box with no timer
To provide followup actions to a user response to message box:
|
shutdown
Turns off the device. |
shutdown [delay]
Where Example To turn off the device:
To turn off the device in 25 seconds:
|
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:
|
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:
|
start
Starts a program on the device. When the |
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:
|
turnoff
Shuts down the device. You can specify a delay (in milliseconds) before shutdown. |
turnoff [time]
Example To turn off the device in 3.5 seconds:
|
uninstall
Removes the specified program from the device. |
uninstall program [force]
Where
Example To remove the program 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 WiFi mobile access point. Note: Supported on devices running Android 4.0 to 8.0.
|
wifiapenable 0|1
Where Example To disable WiFi:
|
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 See The writeprivateprofstring Command for more information. |