Remote Commands for Android

IT Admins want to remotely run a command on Android devices and see it’s output. Unlike Desktop environments where commands are driven via command prompt or PS, Android does not offer a Shell that can be invoked programmatically. Basically the commands are nothing but Intents that they want to invoke remotely.

Intents are a way to interact with the devices remotely like launching a system broadcast or service or activity. Additionally some actions fall under the category of commands and hence can be classified as Remote Commands. Some examples can be remotely deleting all files or a folder, launch an app etc.

With Scalefusion MDM, admins can create remote commands via Scalefusion Dashboard which can then be launched on managed devices to perform a set of actions remotely. The document explains all about Remote Commands for Android devices.

Before You Begin

  1. Users should be subscribed to Scalefusion's Enterprise Plan
  2. The devices should be enrolled in Kiosk or Agent mode

Steps

Step 1: Create a Remote Command

  1. On Scalefusion Dashboard, navigate to Remote Support > Remote Commands and click on Create
  2. This would bring up a pop-up with a list of commands to select from.
  3. Select a command. This opens a form. Fill in the required details and click Save. The commands are explained below
Launch Activity

When you want to remotely launch a specific activity in an installed app, use this command. The command basically describes the activity to start and carries any necessary data. Some examples of launching an activity are dial a number, launch map based on address, launch contacts etc.

To launch activity, select Launch Activity from the list of commands

A form will open. Fill in the details as required.

Field

Description

Enter a Name for the Command

Enter a name with which the command can be identified

Select Mode

Select appropriate mode for the intent which allows the right app to be targetted, from the following:

  • Implicit (selected by default): Implicit mode doesn't specify the component. In such case, intent provides information of available components provided by the system that is to be invoked.
  • Explicit: Explicit mode specifies the component by providing the external class to be invoked.

Enter Action

Enter the action string for the command. For eg. android.intent.action.VIEW

Select Package

Select or enter the package name to which this command is targeted. Package can be chosen from the list in the drop-down. Alternatively, you can be enter the package name if it is not in the list, by selecting the checkbox Enter a Package not in List

Package Name has to be selected when the mode is Explicit

Enter Class Name

Enter the class name within the package to which this command is targeted. For eg. com.android.settings.network.telephony.MobileNetworkActivity

Class Name has to be entered when the mode is Explicit

Enter Category Name

Enter the category string that will be passed along with the command. For example, android.intent.category.HOME

Enter Data Uri

The action string for the intent that will be created. For eg. To launch an activity like Launch Map point based on address, following would be the Data Uri:

geo:0,0?q=1600+Amphitheatre+Parkway,+Mountain+View,+California

Enter Data Type

Enter string for the data type of the intent.

Configure Extras

Add extra details that will passed along with the intent, like the key, its corresponding value, type etc.

The details like Action, Package, Class Name, category name, Data Uri should be known to the admin in regards to the command that has to be remotely executed on the device.

For example, to launch a map point based on address, following details need to be entered. In this case the Map app should be already installed on the device.

Launch Service

A service is an application component that can perform long-running operations in the background. It does not provide a user interface. For example, a service can handle network transactions, play music, start service to display notification always for Remote Commands App etc.. Use this command when you want to remotely launch a service in an installed app by selecting Launch Service from the list of commands and enter details in the form.

Send Broadcast

A broadcast is a message that any app can receive. The system delivers various broadcasts for events, such as when the system boots up or the device starts charging. You can deliver a broadcast to other apps remotely, by selecting Send Broadcast from the list of commands and enter details in the form.

For Launch Activity, Launch Service and Send Broadcast commands, you will need to enter similar set of details in the form to launch the command.

As for example, you can use Send Broadcast to uninstall apps remotely. This helps IT Admins uninstall apps once they detect an unwanted app is installed on device. To uninstall, select the following:

  • Type: Implicit
  • Action: com.mdm.uninstallapps
  • Extras
    • String Array
    • Key: uninstall_app_list
    • Value: String Array
System packages and packages starting with com.promobitech cannot be uninstalled remotely.
Install Apps

With this command you can install an APK file at a specified storage location and file path which remotely installs the apps on the devices. You should have the application downloaded on the device.

The Install Apps command works on EMM Managed devices

In the Remote Command window, click on the command Install Apps.

This opens the Install Apps window. Enter the following details:

Field

Description

Enter a Name for the Command

Enter a name with which the command can be identified

Enter File Path

Enter the folder/file path where the apk should be stored

Storage Location

Select the storage location from the following:

  • Internal
  • External

Auto approve Installed applications

When a device reports an application as installed, this setting (when enabled) automatically approves the application in the respective device profile.

Add more field

Adds another entry field for you to specify another file path, storage location for the apks to be installed

For example, the following will install AppDetail.apk file from the internal storage.

Delete Files / Folders

This command deletes files or all files in a given folder remotely. In the Remote Command window, click on the command Delete Files / Folders.

This opens the Delete Files Folders command window where you need to specify the file / folder location and other details:

Field

Description

Enter a Name for the Command

Enter a name with which the command can be identified

Enter File Path

Enter a file or folder path from where the files are to be deleted

Enter file pattern

To delete files in bulk, enter the pattern. For eg. *.* deletes all files, *.jpg deletes all jpg files

Delete Folder

If checked it deletes the folder as well from the specified location

Add more field

Adds another entry field for you to specify another file/folder path, file pattern for the files to be deleted

For example, the following will delete AppDetail.apk file stored at the specified location on device.

Delete Files command works only for files on internal storage. Files on external SD Card cannot be deleted.
Launch a File

With this command you can remotely launch file on devices. The file should be present on the device. In the Remote Command window, click on the command Launch File.

This opens the Launch file command window where you need to specify the file path and other details. The command when executed will launch the specified file.

Field

Description

Enter a Name for the Command

Enter a name with which the command can be identified

Enter File Path

Enter the folder/file path where the file is stored

Storage Location

Select the storage location of file from the following:

  • Internal
  • External

For example, the following will pick abc.jpg file from the external storage and open on the device's gallery

Step 2: Execute (run) a command

Once a command created, the next step is to run it from the dashboard to be executed on the device. The commands created are listed with the following details.

  1. Click on the three vertical dots under Actions heading on the right, for the command that has to be executed.
  2. Click on Run Now.
  3. This opens up the window where you need to select the Device Groups / Devices on which the command has to be executed. Select the Device Groups / Devices and click Execute

The command will be executed and the action can be viewed on the device.

Other Actions on Remote Commands

Other actions that can be performed on remote commands, are:

These actions can be accessed by clicking on the three vertical dots under Actions heading on the right

Last Run Report: Gives a summarized report of the status of the commands installed on device. For example, for a Launch Activity command, the Last Run report would display following information:

  • DEVICE NAME & STATUS
  • LAST SEEN
  • ACKNOWLEDGED
  • STATUS
  • TIME STAMP
  • ERROR

Similarly for other commands, related information is displayed in the report. This information can be downloaded in CSV format.

Edit: With this, you can edit the command details

Clone: Creates a copy of the command. The copied one has copy added to the command name with which it can be identified

Delete: Deletes the Remote Command. A command once deleted cannot be recovered. To confirm deletion of command, you need to enter your Scalefusion Dashboard login password.


How did we do?


Powered by HelpDocs (opens in a new tab)