public frmSend(string filename) { InitializeComponent(); _filename = filename; server = new SharpAdbClient.AdbServer(); var adbPath = @"C:\android - sdk\platform - tools\adb.exe"; StartServerResult result; if (!System.IO.File.Exists(adbPath)) { adbPath = @"C:\ProgramData\Microsoft\AndroidSDK\25\platform-tools\adb.exe"; } if (!System.IO.File.Exists(adbPath)) { MessageBox.Show("Unable to find adb.exe", "Error"); return; } result = server.StartServer(adbPath, restartServerIfNewer: false); client = new SharpAdbClient.AdbClient(); List <SharpAdbClient.DeviceData> devices = client.GetDevices(); foreach (SharpAdbClient.DeviceData device in devices) { cboListDevices.Items.Add(device); } if (cboListDevices.Items.Count > 0) { cboListDevices.SelectedIndex = 0; } }
public AdbManager(string adbFile) { _deviceList = new Dictionary <string, DeviceData>(); _server = new AdbServer(); if (adbFile != null && File.Exists(adbFile)) { _server.StartServer(adbFile, restartServerIfNewer: false); } else { _server.StartServer(GetAdbPath(), restartServerIfNewer: false); } }
public AdbFileProvider(string rootPath) { try { _server = new SharpAdbClient.AdbServer(); _server.StartServer(@"adb.exe", restartServerIfNewer: false); _rootPath = rootPath; } catch (Exception ex) { Log.LogErr("Exception initializing AdbFileProvider", ex); throw; } }