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 |
---|---|
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 |
afw_prevent_uninstall
Prevents the device user from uninstalling an application that was installed using packages. |
afw_prevent_uninstall bundleID enable|disable
Where Example To prevent the device user from uninstalling the Google Photos app:
|
afw_set_permission_policy
Sets the default response for future runtime permission requests by the SOTI MobiControl device agent. |
afw_set_permission_policy prompt|grant|deny|clear
Where
|
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:
|
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 local SD card on the device:
To copy a folder from the device to ftp server:
|
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
|
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_system_update
Installs a system update from the specified file. 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 on an SD card:
Note: If
/sdcard does not work, use /storage/sdcard0 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
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
|
reset
Performs 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:
|
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 |
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:
|
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
|
set_system_update_policy
Configures 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:
|
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 [/w] program
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. |