AdbFormAdbShellCommand Method AndroidLib - Beatsleigher Edition
Forms an AdbCommand that is passed to Adb.ExecuteAdbCommand()

Namespace: RegawMOD.Android
Assembly: AndroidLib (in AndroidLib.dll) Version: 1.5.2.0 (1.5.2.0)
Syntax

public static AdbCommand FormAdbShellCommand(
	Device device,
	bool rootShell,
	string executable,
	params Object[] args
)

Parameters

device
Type: RegawMOD.AndroidDevice
Specific Device to run the command on
rootShell
Type: SystemBoolean
Specifies if you need executable to run in a root shell
executable
Type: SystemString
Executable file on device to execute
args
Type: SystemObject
Any arguments that need to be sent to executable

Return Value

Type: AdbCommand
AdbCommand that contains formatted command information
Exceptions

ExceptionCondition
DeviceHasNoRootException if device does not have root
Remarks

This should only be used for Adb Shell commands, such as adb shell getprop or adb shell dumpsys.
Examples

This example demonstrates how to create an AdbCommand
//This example shows how to create an AdbCommand object to execute on the running server.
//The command we will create is "adb shell input keyevent KeyEventCode.HOME".
//Notice how in the formation, you don't supply the prefix "adb", because the method takes care of it for you.
//This example also assumes you have a Device instance named device.

AdbCommand adbCmd = Adb.FormAdbCommand(device, true, "input", "keyevent", (int)KeyEventCode.HOME);
See Also

Reference