Script Commands for Android Classic Devices
Use the options and examples below to create 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 SOTI MobiControl Device 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> Enables the administrator to disable automatic Android Enterprise SOTI MobiControl Device Agent updates to the latest versions from the Google Play Store remotely on Android devices through SOTI MobiControl. Minimum SOTI MobiControl Device Agent version: 15.1.5 Android OS: Samsung: API Level 11 and MDM v 5.0+ and later Zebra: API Level 26 and MXMF v10.3 and later OEMs supported: Samsung and Zebra |
app_upgrade disable
<package-list> Example
|
app_upgrade enable <package-list> Enables the administrator to enable automatic Android Enterprise SOTI MobiControl Device Agent updates to the latest versions from the Google Play Store remotely on Android devices through SOTI MobiControl. Minimum SOTI MobiControl Device Agent version: 15.1.5 Android OS: Samsung: API Level 11 and MDM v 5.0+ and later Zebra: API Level 26 and MXMF v10.3 and later OEMs supported: Samsung and Zebra |
app_upgrade enable
<package-list> Example
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):
To remove an application from the Battery Optimization whitelist (the app follows battery optimization restrictions):
|
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 gent installed. In this case,
certdelete removes 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:
|
clearappcache Clears the cache memory of the specified application. Devices supported: Supported
on Android Classic and Work Managed devices. Note:
Minimum Android Device Agent version: 15.3.3 |
clearappcache
packageName Example To clear the cache memory of the Business App application: clearappcache
com.businessapp |
connect
Prompts the SOTI MobiControl Device Agent to try 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, 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:
To delete all files with the extension .tmp in the current directory and its subfolders:
|
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:
|
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:
To remove the ELM agent from the whitelist:
|
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:
|
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 you initiate a hard reset from a package's post-install script, the entire package reinstalls after the reset. Include a check in the pre-install script to assess 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
For platforms that support the
then the pre-install script could contain a check to prevent the package from reinstalling 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 displays in the device's notification area. |
foregroundmode enable|disable
Example To enable
|
ftp
Copies a file or directory from an FTP server to a device. |
ftp [wget] [-o,-r] source
destination
Where:
Example To copy a file from FTP to local storage on the device:
|
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 you do not provide a interfaceName is
provided, then the command uses Use Example To list all interface names:
To show the configuration of eth0 interface
|
import_contacts_vcf This feature enables the
administrator to add Collation/Unicode in
Minimum SOTI MobiControl Device 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:
Example
|
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. This command
supports the following OEMs:
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:
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. It is only
used through the console or an API call to install a previously
side loaded 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 appear as 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
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:
To set the orientation of the lockdown screen to 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
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 its view is in sync. 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 the user to change or set a password on their device by displaying a "Password Policy Pending" notification in the SOTI MobiControl 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 for 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:
Where possible, this command grants permissions without any notifications. |
request_appops_permission
android.permission.SYSTEM_ALERT_WINDOW allow
<Package_ID> Note: This command
is only available for 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 Device Agent as well) to silently display over other applications across all Android devices. Minimum SOTI MobiControl Device 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
for 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: SOTI MobiControl support this command in internal
agent (that is, COPE Work Profile). Disables the ability of any third-party application (this applies to the SOTI MobiControl Device Agent as well) to silently display over other applications across all Android devices. Minimum SOTI MobiControl Device 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 | /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 a new password. |
resetpassword
newPassword
Example To reset the 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 SOTI MobiControl Device Agent. |
restartagent
As of SOTI MobiControl Android Agent v14.3.1, the
SOTI MobiControl Device Agent waits until it is
idle before it restarts (usually 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 remove a location:
|
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:
Example To block a 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 autoplay and controls SOTI Surf access to the device camera. |
sendinfo net.soti.action.surf DISABLEMEDIAAUTOPLAY 0 | 1
Where Example To turn on media autoplay 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 SOTI Surf blocks cookies from third-party domains (that is, domains beyond the site the user is visiting). |
sendinfo net.soti.action.surf ENABLETHIRDPARTYCOOKIES
0|1
Where:
Example To enable 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 SOTI Surf 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
|
set_configurable_kiosk_splash This feature enables the administrator to suppress or change the SOTI Agent logo while in kiosk mode. Minimum SOTI MobiControl Device Agent: 15.2.4, same as lockdown Plugin Versions: Not required Devices supported: Android Classic and Android Enterprise DO Android OS: same as lockdown |
Where:
Examples
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 Example To disable mobile data:
To enable mobile data
|
setradioenable
Enables or disables WiFi, Bluetooth, or cellular networks for the device. If you disable the phone radio, 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:
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 SOTI MobiControlDevice Agent has the following
limitations:
|
showmessagebox message
[timer] [type]
[default button]
[action]
Where:
A global variable stores the return values for the
Example To show a simple message:
To enter 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 enter follow-up actions to a user's response to a message box:
|
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 you specify the
|
start [/wait] program
Note: On Windows devices, you must enclose
program in quotation
marks. Example To start Pocket Word and wait until it is terminated:
|
turnoff
Turns off the device. |
turnoff [delay]
Where Example To turn off the device:
To turn off the device in 25 seconds:
|
uninstall
Removes the specified program from the device. |
uninstall program
[force]
Where:
Example To remove the program Google Maps:
|
uninstall_agent
Removes the Device 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
correctly 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 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 and writesecuresetting Commands for more information. |
writesecureprofstring
This command has the same functionality as
|
See The writeprivateprofstring and writesecuresetting Commands for more information. |