From e2aff76b27fd7890a9cd665cec7c18778be1c7eb Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Fri, 16 Jan 2015 08:42:36 -0800 Subject: [PATCH] Improve the getDeviceSDKVersion call, make it skip errors and bypass if no devices seem to be connected --- tools/helpers/AndroidHelper.hx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/helpers/AndroidHelper.hx b/tools/helpers/AndroidHelper.hx index 7197a2c7c..e667d52f5 100644 --- a/tools/helpers/AndroidHelper.hx +++ b/tools/helpers/AndroidHelper.hx @@ -82,6 +82,9 @@ class AndroidHelper { public static function getDeviceSDKVersion (deviceID:String):Int { + var devices = listDevices (); + if (devices.length == 0) return 0; + var tempFile = PathHelper.getTemporaryFile (); var args = [ "wait-for-device", "shell", "getprop", "ro.build.version.sdk", ">", tempFile ]; @@ -97,11 +100,11 @@ class AndroidHelper { if (PlatformHelper.hostPlatform == Platform.MAC) { - ProcessHelper.runCommand (adbPath, "perl", [ "-e", 'alarm shift @ARGV; exec @ARGV', "3", adbName ].concat (args)); + ProcessHelper.runCommand (adbPath, "perl", [ "-e", 'alarm shift @ARGV; exec @ARGV', "3", adbName ].concat (args), true, true); } else { - ProcessHelper.runCommand (adbPath, adbName, args); + ProcessHelper.runCommand (adbPath, adbName, args, true, true); }