Il est possible d'un AppleScript, voici un exemple de script (testé sur Sierra et Xcode Version 8.3.3):
tell application "Xcode"
tell active workspace document to if exists then
repeat until (loaded) -- Whether the workspace document has finished loading after being opened
delay 1
end repeat
run -- Invoke the "run" scheme action
end if
end tell
Pour exécuter sur un périphérique spécifique: I ne pas avoir de périphériques à tester, mais j'utilise le simulateur, essayez ce script:
tell application "Xcode"
tell active workspace document to if exists then
repeat until (loaded) -- Whether the workspace document has finished loading after being opened
delay 1
end repeat
--**** run on a specific device ****
set active run destination to run destination "iPad Pro (12.9 inch)" -- *** change it to the name of your device ***
set schAction to run -- Invoke the "run" scheme action
repeat while (get status of schAction) is in {not yet started, running} -- exit the loop when the status is (cancelled, failed, error occurred or succeeded), so I press the stop button in Xcode, or I delete the application in the simulator or I quit the simulator.
delay 3
end repeat
--**** run on another specific device ****
set active run destination to run destination "iPhone 7" -- *** change it to the name of your device ***
run
end if
end tell
W C'est rapide et c'est génial! Je vous remercie! Par hasard, savez-vous aussi courir sur un appareil spécifique? Je fais un jeu multijoueur en temps réel et j'ai souvent besoin de deux appareils. Ce serait cool de fonctionner sur un appareil, d'attendre que cela soit fait, puis de courir sur l'autre. – keyboard