MOD: start adb server beforehand

This commit is contained in:
Alan
2021-03-18 22:53:04 +01:00
committed by Joshua Granick
parent 5c94adecd3
commit 7a58c24582

View File

@@ -303,20 +303,14 @@ class AndroidHelper
if (System.hostPlatform != WINDOWS) if (System.hostPlatform != WINDOWS)
{ {
var tempFile = System.getTemporaryFile(); /*
* using System.runProcess on *NIX platforms for `adb devices` usually
System.runCommand('/bin', 'sh', ["-c", '${adbPath}${adbName} devices > ${tempFile}'], true, true); * hangs when adb also starts the server.
* To avoid this, we start the server beforehand
if (FileSystem.exists(tempFile)) */
{ System.runCommand(adbPath, adbName, ["start-server"], true);
output = File.getContent(tempFile);
FileSystem.deleteFile(tempFile);
}
}
else
{
output = System.runProcess(adbPath, adbName, ["devices"], true, true);
} }
output = System.runProcess(adbPath, adbName, ["devices"], true, true);
if (output != null && output != "") if (output != null && output != "")
{ {