Don't freeze on 'adb devices' call on OS X

This commit is contained in:
Joshua Granick
2015-01-19 20:36:39 -08:00
parent d60887b739
commit b71df75953

View File

@@ -282,7 +282,26 @@ class AndroidHelper {
public static function listDevices ():Array <String> {
var devices = new Array <String> ();
var output = ProcessHelper.runProcess (adbPath, adbName, [ "devices" ]);
var output = "";
if (PlatformHelper.hostPlatform == Platform.MAC) {
var tempFile = PathHelper.getTemporaryFile ();
ProcessHelper.runCommand (adbPath, adbName, [ "devices", ">", tempFile ], true, true);
if (FileSystem.exists (tempFile)) {
output = File.getContent (tempFile);
FileSystem.deleteFile (tempFile);
}
} else {
ProcessHelper.runCommand (adbPath, adbName, [ "devices" ], true, true);
}
if (output != null && output != "") {