Commit 9c483510 authored by Adam Barth's avatar Adam Barth

Handle the case of a non-connected Android device better

Previous we dumped a stack trace. Now we produce a more sensible error.
parent ca909c92
......@@ -653,6 +653,12 @@ class AndroidDevice extends Device {
// * daemon started successfully *
runCheckedSync([adbPath, 'start-server']);
String ready = runSync([adbPath, 'shell', 'echo', 'ready']);
if (ready.trim() != 'ready') {
_logging.info('Android device not found.');
return false;
}
// Sample output: '22'
String sdkVersion =
runCheckedSync([adbPath, 'shell', 'getprop', 'ro.build.version.sdk'])
......@@ -670,8 +676,8 @@ class AndroidDevice extends Device {
return false;
}
return true;
} catch (e, stack) {
_logging.severe('Unexpected failure from adb: ', e, stack);
} catch (e) {
_logging.severe('Unexpected failure from adb: ', e);
}
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment