Android Guides | Samples

Android.App.UiAutomation.ExecuteShellCommand Method

Executes a shell command.

Syntax

[Android.Runtime.Register("executeShellCommand", "(Ljava/lang/String;)Landroid/os/ParcelFileDescriptor;", "")]
public ParcelFileDescriptor ExecuteShellCommand (String command)

Parameters

command
The command to execute.

Remarks

Executes a shell command. This method returs a file descriptor that points to the standard output stream. The command execution is similar to running "adb shell " from a host connected to the device.

Note: It is your responsibility to close the retunred file descriptor once you are done reading.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 18