Script Commands for Android Plus 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 | 
|---|---|
| abortpkgHalts 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_modeRetrieves 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 | 
| afw_prevent_uninstallPrevents the device user from uninstalling an application that was installed using packages. | afw_prevent_uninstall bundleID enable|disableWhere  Example To prevent the device user from uninstalling the Google Photos app: 
 | 
| afw_set_permission_policySets the default response for future runtime permission requests by the SOTI MobiControl device agent. | afw_set_permission_policy prompt|grant|deny|clearWhere 
 | 
| appcontrolApplies blacklist rules. This command supports a limited set of parameters. | appcontrol [-s|-b|-w] containerIDWhere 
 Example To add the Facebook app to the blacklist: 
 | 
| batteryoptimizeSpecifies 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 packageExample 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): 
 | 
| certdeleteDeletes a certificate on the device. Note: You can only use  certdeleteto remove certificates that were installed by SOTI MobiControl unless the device has a Samsung ELM agent installed, in which casecertdeletewill remove any specified certificates. | certdelete -issuer "IssuerName" -sn "SerialNumber" -storage "storage"Where 
 Example To delete a certificate issued by apache.org: 
 | 
| certimportImports 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: 
 | 
| connectPrompts 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: 
 | 
| copyCopies 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 destinationExample To copy all files with the extension .txt from the C:\ to the temp directory on the device: C:\tempt\*.txt 1:\temp | 
| delDeletes one or more files. | del filenameExample To delete example.txt in the current directory: 
 To delete all files with the extension .tmp in the current directory and its subfolders: 
 | 
| devrenameRenames a device. | devrename newDeviceNameIf the name contains spaces, use quotation marks Example To change the name of a device to Apricot Candy: 
 | 
| disconnectDisconnects the device from the SOTI MobiControl deployment server. | disconnect | 
| elm_awakenAdds 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|1Example To add ELM agent to whitelist: 
 To remove ELM agent from whitelist: 
 | 
| enable_system_appAllows 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 appBundleIDExample To add Google Chrome to the Android Enterprise container: 
 | 
| finishpkgFinishes 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"finishpkgExample 
 For platforms that support the  
 then the pre-install script could contain a check to prevent the package from being reinstalled endlessly: 
 | 
| foregroundmodeSwitches 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|disableExample To enable  
 | 
| ftpCopies a file or directory from an ftp server. | ftp [get|mget|wget] [-r,-o] source destinationWhere 
 Example To copy a file from ftp to local SD card on the device: 
 To copy a folder from the device to ftp server: 
 | 
| identify_activityIdentifies the current top activity on the device. | identify_activity | 
| identify_package_certificateIdentifies the signature of a package and displays it in the device ADB logs. | identify_package_certificate packageNameExample 
 | 
| ifconfigDisplays the configuration of the network interfaces on the SOTI MobiControl console. | ifconfig interfaceNameWhere if no interfaceName is provided, then  Use  Example To list all interface names: 
 To show the configuration of eth0 interface 
 | 
| installInstalls an application on the device. | install appInstallerPathWhere 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_system_updateInstalls a system update from the specified file. Note: This command cannot be used on encrypted devices. Use the  sendintentcommand instead. | install_system_update filenameExample To install a system update from a file on an SD card: 
 Note: If  /sdcarddoes not work, use/storage/sdcard0instead, as in:
 | 
| installpackageInstalls 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 pathToPackageExample To install a package from the %tmp% folder: 
 | 
| ipaddrLists the IP addresses of the device. | ipaddr | 
| kill_applicationTerminates a process that is currently running on the device. Requires 
 | kill_application packageNameExample To terminate the Angry Birds game process on the device 
 | 
| list_volumesLists storage volume information of remote managed device. The results are displayed using a custom event on the console. | list_volumes | 
| lockTurns the device screen off and locks device until device user enters the correct password. | lock | 
| lockdownorientationSets the orientation of the device screen while its in lockdown or kiosk mode. | lockdownorientation orientationWhere 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: 
 | 
| logSends 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 messageWhere  
 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 
 | 
| malwarescanInitiates a Webroot scan for malware on the device. | malwarescan | 
| mkdirormdCreates a new directory. | mkdir [drive:] pathExample To create a directory named "test" from the current directory: 
 To create  
 | 
| mxconfigSubmits XML configuration instructions to the MX layer of the device. Note: This script command is only applicable on Zebra Android devices.  mxconfiguses the StageNow XML format (MXMS) | mxconfig xmlFilepathExample 
 | 
| mxxmlconfigExecutes an xml command from the  Note: This command is only supported on devices that support the older XML format (MX Legacy). | mxxmlconfig inputPath outputPathWhere 
 | 
| notifySends 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 aliasornotify package receiverWhere  Example To notify kiosk about data sync: 
 
 | 
| promptpasswordchangePrompts user to change or set a password on their device by displaying a "Password Policy Pending" notification in the device agent. | promptpasswordchange | 
| remInserts a comment line in a script/batch file. | rem [comment]Example To add a comment about pumpkins: 
 | 
| removemanagedinfoRemoves Samsung managed information for specified applications. Note: This command is only available on Samsung devices. | removemanagedinfo packageName | 
| resetPerforms a soft or hard reset of the device. | reset [/S | /H | /W | /E] [/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: 
 | 
| resetpasswordResets device password to new password. | resetpassword  newPassword Example To reset current password to password12345 
 | 
| resetwifiproxyClears 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 ssidExample To reset a proxy configuration for SSID 105: 
 | 
| restartagentRestarts the device agent. | restartagentAs of Android agent v14.3.1, the agent waits until it's idle before it restarts (generally less than 10 seconds). Add  | 
| rmdirorrdDeletes a directory. | rmdir [/S] pathWhere  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.surf BROWSERZOOMLEVELSets the zoom level in the SOTI Surf app. | sendinfo net.soti.action.surf BROWSERZOOMLEVEL valueWhere value is a percentage that represents the level of zoom. Example To set the zoom level of the SOTI Surf app to 400%: 
 | 
| sendintentSends intent to devices. See The sendintent Command for more information | |
| sendreportSends a debug report from the device agent to the SOTI ftp server. | sendreport | 
| set_system_update_policyConfigures the system update policy for Android devices with work feature enabled. Note: Supported on Android Enterprise Managed Devices running Android 6.0 or later with an agent of 13.8.x or earlier.
									 Devices with later agents (13.9.0+) should use a  | set_system_update_policy policy type [startTime] [endTime]Where 
 Note: For the Windowed policy, time parameters are measured as the number of minutes from midnight in the device's local time. They range from 0-1440. If the start and end times are the same, the window includes the whole 24 hours, that is, updates can install at any time. If the start time is later than the end time, the window spans midnight. Example To set the system update policy as default: 
 To set the system update policy as windowed with the maintenance window set to occur from 11 pm to 3 am: 
 | 
| setfirewallproxySets proxy configuration on device level (iptables based). Note: Supported on devices with Samsung MDM v2 and later only. | setfirewallproxy  host port containerIDExample 
 | 
| setlocaleSets the device's default locale. Note: Supported on Motorola Android Plus devices with a signed agent only. | setlocale locale | 
| setmobiledataEnables 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|1Where  Example To disable mobile data: 
 To enable mobile data 
 | 
| setradioenableEnables 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|1Where 
 Example To disable Bluetooth radio 
 To enable WiFi 
 | 
| setwifiproxySets 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 portExample To set up a WiFi proxy: 
 | 
| setwifipacurlSets 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 PACfileURLExample To set up a WiFi proxy using a PAC file: 
 | 
| showmessageboxDisplays 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:  | 
| shutdownTurns off the device. | shutdown [delay]Where  Example To turn off the device: 
 To turn off the device in 25 seconds: 
 | 
| sleepInitiates 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: 
 | 
| sleepexInitiates 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: 
 | 
| startStarts a program on the device. When the  | start [/wait] programNote: On Windows devices, program must be enclosed in quotation marks. Example To start Pocket Word and wait until it is terminated: 
 | 
| turnoffShuts down the device. You can specify a delay (in milliseconds) before shutdown. | turnoff [time]Example To turn off the device in 3.5 seconds: 
 | 
| uninstallRemoves the specified program from the device. | uninstall [/w] programWhere 
 Example To remove the program Google Maps: 
 | 
| uninstall_agentRemoves 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 | 
| unlockUnlocks the device and dismisses the password lock screen. | unlock | 
| updatedefinitionsPrompts Webroot to update its malware definitions. | updatedefinitions | 
| wifiapenableEnables or disables WiFi mobile access point. Note: Supported on devices running Android 4.0 to 8.0. | wifiapenable 0|1Where  Example To disable WiFi: 
 | 
| wifireconnectForces the device to drop a WiFi connection and reconnect. Note: Supported on devices running Android 4.0 or later with Android Plus capabilities. | wifireconnect | 
| wipeapplicationWipes application data for the specified application from the device. | wipeapplication packageName | 
| writeprivateprofstringSaves or deletes specified settings on a device. See The writeprivateprofstring Command for more information. | |
| writesecureprofstringThis command has the same functionality as  See The writeprivateprofstring Command for more information. |