/// <summary> /// 检查是否正常安装ADB /// </summary> /// <returns></returns> static public bool CheckADB() { //string r = CmdHelper.ExecCmd("ipconfig"); string r = CmdHelper.ExecCmd("adb"); if (r.Contains("不是内部或外部命令") || r.Contains("is not recognized as an internal or external command")) { return(false); } return(true); }
static public List <Device> GetDevices() { List <Device> devices = new List <Device>(); string cmd = String.Format("{0} -l", dicADBDebuggingCommands["devices"]); string r = CmdHelper.ExecCmd(cmd); string result = CmdHelper.GetCMDResult(r); string devicesStr = result.SubStringAfter("List of devices attached"); //c66e333b device product:dipper model:MI_8 device:dipper transport_id:51 string[] devicesStrs = devicesStr.Split(new String[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); foreach (var deviceStr in devicesStrs) { devices.Add(new Device(deviceStr)); } return(devices); }