Android custom commands
Run remote actions by using custom commands on the managed Android devices.
In addition to default device actions available in the IBM® MaaS360® Portal, you can use custom commands to run dynamic actions on managed devices. After you send a custom command, you can track the execution status of all commands in the Device History page in the IBM MaaS360 Portal. This feature requires MaaS360 for Android app version 7.40 and later.
Supported custom commands
Action | Description | Command |
---|---|---|
Enable kiosk mode | Starts kiosk mode on the devices. The following requirements must be met.
|
enable-kiosk |
Launch app | Starts the specified app on the device. The following requirement must be met.
|
launch-app <package name>. Examples,
|
Start activity | Starts an instance of the activity that has an intent. Device
support
The following requirement must be met.
|
start-activity <intent options> |
Start broadcast | Broadcast the specified intent to the device. | send-broadcast <intent options> |
Clear app data | Clears app data. This command supports multiple app IDs. The requirements are as follows.
|
clear-app-data <comma-separated app IDs>
|
Download eSIM | Downloads eSIM on the device. The requirements are as follows.
|
<download e-sim options> |
Delete eSIM | Deletes eSIM on the device. The requirements are as follows.
|
<delete e-sim options> |
Uninstall single app |
The following requirement must be met.
The following error messages are displayed when the conditions are not satisfied.
|
uninstall-single-app <packageName> |
Intent options
Intent options | Description | Example |
---|---|---|
-a | Set the action on the intent |
|
-c | Add a category to an intent | start-activity -c android.intent.category.HOME -a android.intent.action.MAIN starts the Home screen. |
-d | Set the data URL on the intent | start-activity -a android.intent.action.VIEW -d http://www.google.com opens google.com in a browser app. The command fails if a browser app is not installed. |
-t | Set the MIME type on the intent | start-activity -t image/* -a android.intent.action.VIEW opens the Gallery or any app that displays images. A list of apps is displayed for multiple apps. |
-n | Set the specific intent component | start-activity -n com.example.sampleapp/.SaveFileActivity opens the sample app Save File screen. If "SaveFileActivity" is not exported, the command fails. |
-es, -eb, -ei, -ed, -en, -eia, -esa, -eba, -eda (For string data, you must use quotation marks around the string to specify the value) |
Add data/extras as a key-value pair to intent | -es - String start-activity -n com.example.sampleapp/.MyActivity -es EXTRA "Life is Great" opens the specific activity "MyActivity" and sends the string data in the form of a key-value pair (key: "EXTRA" value: "Life is Great") to the activity. If "MyActivity" is not exported, the command fails. |
-eb - Boolean start-activity -n
com.example.sampleapp/.MyActivity -eb Status true opens the specific activity
"MyActivity" and sends the Boolean data in the form of a key-value pair (key:"Status" value: true)
to the activity.
Note: If "MyActivity" is not exported, the command fails.
|
||
-ed - Double/Float start-activity -n com.example.sampleapp/.MyActivity -ed Code 999.9878 opens the specific activity "MyActivity" and sends the double or float data in the form of a key-value pair (key:"Code" value: 999.9878) to the activity. If "MyActivity" is not exported, the command fails. |
||
-ei - Integer start-activity -n com.example.sampleapp/.MyActivity -ei Code 999 opens the specific activity "MyActivity" and sends the integer data in the form of a key-value pair (key:"Code" value: 999) to the activity. If "MyActivity" is not exported, the command fails. |
||
-esa - String Array start-activity -n com.example.sampleapp/.MyActivity -esa Months "[Jan,Feb,March]" opens the specific activity "MyActivity" and sends the string array data in the form of a key-value pair (key: "Months" value: "[Jan,Feb,Mar]") to the activity. If "MyActivity" is not exported, the command fails. |
||
-eba - Boolean Array start-activity -n com.example.sampleapp/.MyActivity -eba Status [true, false, false, false] opens the specific activity "MyActivity" and sends the Boolean array data in the form of a key-value pair (key:"Status" value: [true, false, false, false]) to the activity. If "MyActivity" is not exported, the command fails. |
||
-eda - Double/Float Array start-activity -n com.example.sampleapp/.MyActivity -eda Codes [10.33, 12.33, 14.33, 15.33] opens the specific activity "MyActivity" and sends the double or float array data in the form of a key-value pair (key:"Codes" value: [10.33, 12.33, 14.33, 15.33]) to the activity. If "MyActivity" is not exported, the command fails. |
||
-eia - Integer Array start-activity -n com.example.sampleapp/.MyActivity -eia Codes [998, 999, 1000] opens the specific activity "MyActivity" and sends the integer array data in the form of a key-value pair (key:"Codes" value: [998, 999, 1000]) to the activity. If "MyActivity" is not exported, the command fails. |
||
-en - Null start-activity -n com.example.sampleapp/.MyActivity -en DataValue null opens the specific activity "MyActivity" and sends the null data in the form of a key-value pair (key: "DataValue" value: null) to the activity. If "MyActivity" is not exported, the command fails. If you want to pass null, use the -en option. If you use other options to pass null, the command fails. |
Download-eSIM options
Download options | Description | Required or Optional | Example |
---|---|---|---|
-ac | Set the eSIM activation code | Required | download-esim -ac LPA:1smdprd.jio.comBDB39E0CE8D69C33511E699FA8C47FCC |
-sd | Select whether to switch to the eSIM automatically after download. The values are
true or false (default).Note:
|
Optional | download-esim -sd true -ac LPA:1smdprd.jio.comBDB39E0CE8D69C33511E699FA8C47FCC |
-sn | Select whether to notify the user after download. The values are true
(default) or false . |
Optional | download-esim -sn false -ac LPA:1smdprd.jio.comBDB39E0CE8D69C33511E699FA8C47FCC |
Delete-eSIM options
Delete options | Description | Required or Optional | Example |
---|---|---|---|
-ic | Set the ICCID number of the eSIM. | Required | delete-esim -ic 8988303000000614227 |
-sn | Select whether to notify the user after download. The values are true
(default) or false . |
Optional | delete-esim -sn false -ic 8988303000000614227 |
Custom command requirements
- The angle brackets < and > are not supported.
- You cannot use the word script, and the signs < and > more than one time.
- The maximum character limit is 2500.
Pushing custom commands to devices
You can issue custom commands to an individual device or a group of devices.
- Go to and then select a device.
- On the Device Summary page, click More and select Android Custom Command.
- Enter the custom command and click Run.
- Go to .
- Hover over the More option for the device group and select Manage Android Devices.
- On the Manage Android Devices window, select Android Custom Command from Action.
- Enter the custom command and click Run.
Tracking the execution status of commands
- Completed, if the action is successfully implemented on the device.
- Error, if the action failed to run. The error details are displayed in the Error Description column.