C# Class SharpAdbClient.AdbCommandLineClient

Provides methods for interacting with the adb.exe command line client.
Inheritance: IAdbCommandLineClient
ファイルを表示 Open project: ArduPilot/MissionPlanner

Public Methods

Method Description
AdbCommandLineClient ( string adbPath ) : SharpAdbClient.Exceptions

Initializes a new instance of the AdbCommandLineClient class.

GetVersion ( ) : System.Version

Queries adb for its version number and checks it against AdbServer.RequiredAdbVersion.

IsValidAdbFile ( string adbPath ) : bool
StartServer ( ) : void

Starts the adb server by running the adb start-server command.

Protected Methods

Method Description
RunAdbProcess ( string command, List errorOutput, List standardOutput ) : void

Runs the adb.exe process, invoking a specific command, and reads the standard output and standard error output.

Use this command only for adb commands that return immediately, such as adb version. This operation times out after 5 seconds.

RunAdbProcessInner ( string command, List errorOutput, List standardOutput ) : int

Runs the adb.exe process, invoking a specific command, and reads the standard output and standard error output.

Use this command only for adb commands that return immediately, such as adb version. This operation times out after 5 seconds.

Private Methods

Method Description
GetVersionFromOutput ( List output ) : System.Version

Parses the output of the adb.exe version command and determines the adb version.

Method Details

AdbCommandLineClient() public method

Initializes a new instance of the AdbCommandLineClient class.
public AdbCommandLineClient ( string adbPath ) : SharpAdbClient.Exceptions
adbPath string /// The path to the adb.exe executable. ///
return SharpAdbClient.Exceptions

GetVersion() public method

Queries adb for its version number and checks it against AdbServer.RequiredAdbVersion.
public GetVersion ( ) : System.Version
return System.Version

IsValidAdbFile() public method

public IsValidAdbFile ( string adbPath ) : bool
adbPath string
return bool

RunAdbProcess() protected method

Runs the adb.exe process, invoking a specific command, and reads the standard output and standard error output.

Use this command only for adb commands that return immediately, such as adb version. This operation times out after 5 seconds.

/// The process exited with an exit code other than 0. ///
protected RunAdbProcess ( string command, List errorOutput, List standardOutput ) : void
command string /// The adb.exe command to invoke, such as version or start-server. ///
errorOutput List /// A list in which to store the standard error output. Each line is added as a new entry. /// This value can be if you are not interested in the standard /// error. ///
standardOutput List /// A list in which to store the standard output. Each line is added as a new entry. /// This value can be if you are not interested in the standard /// output. ///
return void

RunAdbProcessInner() protected method

Runs the adb.exe process, invoking a specific command, and reads the standard output and standard error output.

Use this command only for adb commands that return immediately, such as adb version. This operation times out after 5 seconds.

protected RunAdbProcessInner ( string command, List errorOutput, List standardOutput ) : int
command string /// The adb.exe command to invoke, such as version or start-server. ///
errorOutput List /// A list in which to store the standard error output. Each line is added as a new entry. /// This value can be if you are not interested in the standard /// error. ///
standardOutput List /// A list in which to store the standard output. Each line is added as a new entry. /// This value can be if you are not interested in the standard /// output. ///
return int

StartServer() public method

Starts the adb server by running the adb start-server command.
public StartServer ( ) : void
return void