Introduction to creating and sending commands

Read our introduction to device overview to get a better understanding of the MDM capabilities of emteria Device Hub.

Article overview:
How to create and send a new command
Examples tab
Commands tab
Editor tab
Command examples


How to create and send a new command

  1. Log in to your Device Hub.
  2. Use the sidebar to navigate to Devices.
    navigate_to_devices
  3. In the Devices overview select a specific device or a device group.
  4. Navigate to the Commands tab. Now you're in the main MDM page of your device or device group.
    commands
  5. Click on the plus symbol (+) to open the Command dialog.
  6. Now the New Command window opens.

Here you will find the following three tabs:
Examples
Commands
Editor

NewCommandsMDM2

When you create a new command, it will be immediately sent to the device.
If required you can add this command to the group policy.

Examples tab

In the Examples tab you will find a subset of all available commands which are pre-filled with exemplary values for very specific use cases.

The following commands are available in the Examples tab:

  • Change bootanimation
  • Change password visibility
  • Change screen rotation
  • Change time zone
  • Setup autostart mode
  • Setup autostart apps
  • Setup kiosk mode
  • Setup kiosk setting
  • Setup kiosk password
  • Setup kiosk apps
  • Start automatic OS update
  • Submit new bugreport

Commands tab

In the Commands tab you will find all commands that we currently support. These commands often require additional information in the form of free text.
Below you will find some of the frequently asked for actions on a device, which might consist of several commands.


For the list of all available MDM commands and their use cases visit our overview of Mobile Device Management commands.

Editor tab

In the Editor tab you can create your own commands.

Note: This feature is only for advanced users.

The command structure follows the JSON format and the Command Editor can be found in two places, the Device overview and in the Group overview under the Commands tab.

commands

With the Properties button it is possible to create custom commands by adding, renaming or removing the arguments that would be subsequently transformed into a JSON structure. However, if you prefer to edit JSONs directly, you can do so after clicking on the JSON button. Then you can either type directly into the text field, or copy-paste your prepared JSON commands.
NCEditor_both

Each command JSON is required to have the attribute "command" with the String value of the name of the specific command. Below is an example of how the JSON would look for the “Change Preference” command that would change a password for the Kiosk Mode.

{
"command": "changePreference",
"package": "com.emteria.kiosk",
"category": "com.emteria.kiosk_preferences",
"key": "prefs_password_key",
"type": "string",
"value": "test_password"
}

Command examples

Enable "adb over Ethernet":

{
"command": "processSubcommands",
"success": "all",
"subcommands": [
{
"command": "changeProperty",
"property": "persist.sys.usb.config",
"value": "adb"
},
{
"command": "changeProperty",
"property": "persist.adb.tcp.port",
"value": "5555"
}
]
}

Disable “adb over Ethernet”:

{
"command": "processSubcommands",
"success": "all",
"subcommands": [
{
"command": "changeProperty",
"property": "persist.sys.usb.config",
"value": "none"
},
{
"command": "changeProperty",
"property": "persist.adb.tcp.port",
"value": ""
}
]
}

Reboot your device afterwards


How to enable VNC
  • Change system property
    • Property name: persist.sys.vncd.enabled
    • New value: 1
  • Change system property
    • Property name: ctl.restart
    • New value: vncd
How to enable SSH
  • Assuming you have setup keys according to: SSH Server Tutorial
  • Change system property
    • Property name: persist.sys.sshd.enabled
    • New value: 1
  • Change system property
    • Property name: ctl.restart
    • New value: sshd

How to change the password to access settings from kiosk mode

{  
"command": "changePreference",
"package": "com.emteria.kiosk",
"category": "com.emteria.kiosk_preferences",
"key": "prefs_password_key",
"type": "string",
"value": "password"
}

How to enforce virtual input keys

If you have other USB input devices connected (keyboards, mice, barcode scanners, Bluetooth receivers) Android might think you are using an external keyboard and will hide the virtual input keys. If you would like to enforce them, you can add the following Change system setting command:

  • Section name: secure
  • Setting type: integer
  • Setting key: show_ime_with_hard_keyboard
  • Setting value: 1
    MDM-NCEditor-6