Script Commands for Android Enterprise: Managed Devices
Legend
Format | Meaning |
---|---|
text |
Enter the command exactly as shown. |
text |
Replace with the required information. |
[text] | Square brackets indicate optional values or parameters. |
text|text |
Choose one of the options separated by the vertical pipe. |
Commands
Command | Syntax |
---|---|
2G Disabling | writeprivateprofstring DeviceFeature DisableCellular2G
{number} apply
featurecontrol Where:
|
_adminmode
Enables or disables the administrator mode on a device in lockdown mode. |
_adminmode on|off |
afw_prevent_uninstall
Prevents the device user from uninstalling an application installed via a package. |
afw_prevent_uninstall bundleID
enable|disable
Where To prevent the
device user from uninstalling Google
Photos:
|
afw_set_permission_grant_state
Grants or revokes specific permissions for specified
applications. Note: Special permissions
such as Draw Over or Usage Access cannot be granted to
third-party apps. For a full list of all the permissions available and the API levels, refer to Google's Manifest.permission documentation. |
afw_set_permission_grant_state packageName permissionName
allow|deny|default Example: To enable view
device information permission for an
application:
|
afw_set_permission_policy
Sets the default behaviour for future runtime permission requests by the SOTI MobiControl Device Agent. |
afw_set_permission_policy
prompt|grant|deny|clear
Where:
|
afw_set_preferred_keyboard
Specifies a preferred keyboard for use on the device. Note: Requirements:
Note: This setting does not
prevent users from changing the keyboard
manually. |
afw_set_preferred_keyboard <package_name>
Where
|
afw_work_profile
Enables or disables the Android Enterprise work profile. |
afw_work_profile enable|disable
|
agent_mode
Retrieves the current SOTI MobiControl Device Agent mode (user or administrator) of a device in lockdown mode and displays it in the Logs section of the Device Information panel. |
agent_mode |
app_upgrade disable <package-list> Disables automatic updates of the Android Enterprise SOTI MobiControl Device Agent on Android devices, regardless of the update source. Note: Requirements:
|
app_upgrade disable <package-list> Example: to prevent an
application from
updating:
|
app_upgrade enable <package-list> Enables
automatic updates of the Android Enterprise SOTI MobiControl Device Agent from the Google Play
Store. Note: Requirements:
|
app_upgrade enable
<package-list> Example: To enable an
application to
update:
Note: For Samsung devices, you can omit
<package-list> . |
certdelete
Deletes a certificate on the device.
Note: By default, certdelete removes only
certificates installed by SOTI MobiControl. If a Samsung ELM agent is installed, it can remove any
specified certificates. |
certdelete -issuer "IssuerName" -sn
"SerialNumber" -storage
"storage"
Where:
Example: To delete a certificate issued by
apache.org :
|
clearappcache Clears the cache memory of a
specified application. This script supports both Android Classic
and Work Managed devices. Note:
|
clearappcache
packageName Example: To clear the cache memory of the Business App application:
|
connect
Prompts the SOTI MobiControl Device Agent to try to connect to the deployment server. |
connect [-f] Where
|
devrename
Renames a device.
Note: Use quotation marks
if the name includes spaces. |
devrename newDeviceName
Example: To rename a
device:
|
disconnect
Disconnects the device from the SOTI MobiControl deployment server. |
disconnect |
disable_mac_randomization Allows the administrator to enable or disable Wi-Fi MAC Randomization, or restrict it to either Use device MAC or Random. Note: Requirements:
|
disable_mac_randomization [0 |
1] Example:
|
_efota Enrolls or upgrades Samsung devices using Enterprise Firmware Over-The-Air (E-FOTA). |
_efota enroll|upgrade corpID
targetVersion Where corpID is the customer ID and targetVersion is the Samsung firmware version. |
elm_awaken
Adds or removes the Samsung ELM agent to/from the Android Doze Mode whitelist. This allows the agent to bypass battery optimizations that limit connectivity with the deployment server. Note: Available on Samsung
devices running Android 6.0 or later with Knox Standard SDK 5.7
or later.
|
elm_awaken 0|1
Where:
Example:
|
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 enable Google
Chrome:
|
ftp
Copies a file or directory from a File Transfer Protocol (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
Displays the current top activity running on the device. |
identify_activity |
import_contacts_vcf This feature enables the
administrator to add Collation/Unicode in
Note: Requires minimum SOTI MobiControl Device Agent version:
15.2.4. Note: This is a generic
implementation. There is no OS or OEM limitation. |
import_contacts_vcf <filePath>
1/0
<charsetName> Where:
Example: Replace contacts using a UTF-8 encoded
.vcf
file:
|
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 Gmail from the 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 is
unavailable,
use:
|
kill_application
Terminates an application currently running on the device. Requires:
|
kill_application packageName
Example: To terminate the Angry Birds game process on the
device:
|
lock
Turns off the device screen and locks it until the device user enters the correct password. |
lock
|
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: Include the command in the pre-install
script.
|
mxconfig
Submits XML configuration instructions to the MX layer of the device. Note: This command is supported
only on Zebra Android devices. The command
mxconfig uses the StageNow XML format
(MXMS). |
mxconfig xmlFilepath
Example:
|
notify kiosk
Enables or disables lockdown (kiosk) mode on the device. |
notify kiosk on | off |
read_activities
Lists all activities of an application package. |
read_activities
packageName |
request_appops_permission
Sends a request to the device, prompting the user to grant the specified permissions. Important: Install the device agent plugin (if applicable)
before using this script. Visit the SOTI Pulse Device Agent Downloads
page to check whether your device requires a
plugin. |
request_appops_permission
permissionName Where the
permissionName can be one of the
following:
Where possible, this command grants permissions silently without user notification. |
request_appops_permission android.permission.SYSTEM_ALERT_WINDOW allow
<Package_ID> Important: Install the device agent's plugin if
applicable before using this script. Visit the SOTI Pulse Device Agent Downloads
page to check whether your device requires a
plugin. 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 |
request_appops_permission
android.permission.SYSTEM_ALERT_WINDOW allow
<Package_ID>
Example:
|
request_appops_permission android.permission.SYSTEM_ALERT_WINDOW disallow
<Package_ID> Important: Install the device agent's plugin if
applicable before using this script. Visit the SOTI Pulse Device Agent Downloads
page to check whether your device requires a
plugin. Note: This command is 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 supports 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 |
request_appops_permission
android.permission.SYSTEM_ALERT_WINDOW disallow
<Package_ID>
Example:
|
request_bug_report
Requests permission from the device user to send bug reports back to SOTI MobiControl. |
request_bug_report |
resetenterpriseaccount Adds a new Android Enterprise binding if the device was not enrolled with one, or switches the binding from one Enterprise Account ID to another. |
resetenterpriseaccount
https://SERVER_URL/mc/mdm/android/appcatalog/RequestEmmToken/<ENTERPRISE_ACCOUNT_ID>/<deviceid>/
1
Where:
Tip: Find the
Enterprise Account ID of your Android Enterprise account by
going to the Managed Google Play portal. This portal is
accessible when adding an Android Enterprise Managed Google Play
app in an application policy. Example: To set
the Android Enterprise device with the device ID of
2468b06d9473 with a Managed Android
Enterprise account having the Android Enterprise Account ID of
LC03scj93s :
|
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:
Example To reset an Android Plus device to its factory settings in 30 seconds:
|
_resetfailedrcdetectionflag
Resets the remote control detection attempt counter. |
_resetfailedrcdetectionflag
|
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 14.3.1, the SOTI MobiControl Device Agent waits until it is
idle before restarting (usually less than 10 seconds). Add
|
revoke_device_admin <package> Revokes device admin permissions from third-party applications. This script is for applications installed via the Google Play Store or Android App packages. Minimum SOTI MobiControl Device Agent version: 15.4.5 Plugin version: 1.25.1 Management Type: Android Enterprise devices (Work Managed only) with plugins Android OS: 5 and later Limitations:
|
revoke_device_admin "com.android.chrome" Do not leave the Android App package name blank. |
ring_device
Ring an Android Enterprise (AE) device remotely. This script is useful for locating a device or testing its ringtone and volume. Minimum SOTI MobiControl Device Agent version: 14.4.5 Management Type: Android Enterprise devices (Work Managed) |
ring_device volume
time
isVibrate Where you specify:
Example: Rings a device at its default volume for 60 seconds.
Example: Rings a device at 40% of its maximum volume
for 60
seconds.
Example: Rings a device at 40% of its maximum volume for 10 seconds.
Example: Rings and vibrates a device at 40% of its maximum volume for 10 seconds.
|
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:
|
sendreport
Sends a debug report from the SOTI MobiControl device agent to the SOTI Secure File Transfer Protocol (SFTP) server (sftp.soti.net) over port 22. |
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 a SOTI MobiControl Device Agent of 13.8.x or earlier.
Devices with later agents (13.9.0+) should use either
|
set_system_update_policy policy type [startTime]
[endTime]
Where:
Note: Windowed policy measures time parameters as the number of
minutes from midnight in the device's local time. They range
from 0 to 1440. When the start and end times are the same, the window spans 24 hours, allowing updates to 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:
Example To set the system update policy as windowed with the maintenance window set to occur from 11 PM to 3 AM:
|
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:
Example
Note: The system returns an error if you do not supply an
argument. |
setwifipacurl
Sets Wi-Fi proxy settings using a provided Proxy Auto-Configuration (PAC) file. Make sure that the access point ID exists on the device before sending this command. Note: Supported on devices running Android
4.0.
|
setwifipacurl ssid PACfileURL
Example To set up a Wi-Fi proxy using a PAC file:
|
setwifiproxy
Sets Wi-Fi proxy settings using a provided host and port for the specified SSID. Make sure that the access point ID exists on the device before sending this command. Note: Supported on
devices running Android 4.0.
|
setwifiproxy ssid host port
Example To set up a Wi-Fi proxy:
|
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:
Example To enter device information using a macro:
Example To set a 3-second timer to your message:
Example To add YES and NO buttons to your message box with no timer:
Example 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:
|
turnoff
Turns off the device. |
turnoff [delay]
Where Example To turn off the device:
Example 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:
|
unlock
Unlocks the device and dismisses the password lock screen. |
unlock
|
wifiapenable
Enables or disables a Wi-Fi mobile access point. Note: Supported on devices running Android 4.0 to
8.0.
|
wifiapenable 0|1
Where Example To disable Wi-Fi:
|
wipeapplication
Wipes application data for the specified application from the device. |
wipeapplication packageName Example To wipe Contacts and related application data on a Samsung OS 11+ device: Wipe Contacts App Data
|
writeprivateprofstring
Saves or deletes specified settings on a device. |
See The writeprivateprofstring and writesecuresetting Commands for more information. |