Last active
September 4, 2019 11:23
-
-
Save guttentag/7a6f38cd804ee7d8996b120e4c83f9cd to your computer and use it in GitHub Desktop.
XCODE - Run app on all connected devices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run(input, parameters) { | |
var xcode = Application("Xcode"); | |
var ws = xcode.activeWorkspaceDocument(); | |
var genericDest = null; | |
var devices = []; | |
ws.runDestinations().forEach(function(runDest) | |
{ | |
if (runDest.platform() != "iphoneos") | |
return; | |
if (runDest.device().generic()) | |
{ | |
genericDest = runDest; | |
} | |
else | |
{ | |
devices.push(runDest); | |
} | |
}); | |
devices.forEach(function(device) | |
{ | |
ws.activeRunDestination = device; | |
var buildResult = ws.run(); | |
while (true) | |
{ | |
if (buildResult.completed()) | |
break; | |
if (buildResult.buildLog() && buildResult.buildLog().endsWith("Build succeeded\n")) | |
break; | |
delay(1); | |
} | |
delay(1); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment