Skip to content

Service Adb

MilleBo edited this page Mar 3, 2017 · 1 revision

Access the adb service through the device class, for example:

device.Adb.Shell("shell command");

All available adb methods

/// <summary>
/// Issues a shell command in the target emulator/device instance and then exits the remote shell
/// </summary>
/// <param name="command">Command to execute</param>
/// <returns>The result from executing the command</returns>
string Shell(string command);

/// <summary>
/// Copies a specified file from your development computer to an emulator/device instance.
/// </summary>
/// <param name="localPath">Path to local file</param>
/// <param name="remotePath">Path to destionation on device/emulator</param>
/// <exception cref="AdbException">Thrown when fail to push file</exception>
void Push(string localPath, string remotePath);

/// <summary>
/// Copies a specified file from an emulator/device instance to your development computer.
/// </summary>
/// <param name="remotePath">Path to file on device/emulato</param>
/// <param name="localPath">Path to destionation on local computer</param>
/// <exception cref="AdbException">Thrown when fail to pull file</exception>
void Pull(string remotePath, string localPath);

/// <summary>
/// Dump logcat to a local file
/// </summary>
/// <param name="localPath">Path to destination on local computer</param>
void DumpLogcat(string localPath);

/// <summary>
/// Pushes an Android application (specified as a full path to an APK file) to an emulator/device.
/// </summary>
/// <param name="path">Full path to apk</param>
/// <param name="shouldReinstall">True if we should use the reinstall flag </param>
void InstallApp(string path, bool shouldReinstall = true);
Clone this wiki locally