Bring iPhone Simulator to front of screen on build?
-
19-09-2019 - |
Question
When I build using MonoDevelop using the MonoTouch framework it appears the iPhone Simulator always loads in the background, is there any way to bring this to the front instead of always having to click it in the dock to bring it up?
Can't find anything in preferences.
Solution
Include a compiled AppleScript in your build process:
tell application "iPhone Simulator" activate end tell
OTHER TIPS
Create a new AppleScript file e.g.
simulator.scpt
and add this code:tell application "Simulator" activate end tell
Compile and export as a script, optionally code sign it.
In Xcode, select the target, click + at the top, under 'Build Phases'.
Select 'New run script phase'.
In the run script, paste
osascript /<file path>/simulator.scpt
Move 'Run scripts' under 'Target dependencies'.
This will bring the simulator to the front of all windows during build or unit testing.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow