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