iphoneipadbuildios-simulatorxcode5

How to 'Build & Run' on multiple destinations at once in Xcode?


How can one run a project on multiple destinations (say, iPhone, iPad and iSimulator) at once? Xcode Product optionsXcode multiple destinations


There are 2 related questions:

  1. Xcode 4 - One Click Build to Multiple Devices?
  2. Run on simulator and phone with one click

The 1ˢᵗ question (supposedly) has an answer, but I can't figure out how exactly should you use the Aggregate target (if this is the right direction at all), and apparently neither could Josh Kahane, the OP; the "answer" still somehow got/remained accepted.

The 2ⁿᵈ question was closed down as a "duplicate", as if the 1ˢᵗ one provided a (workable) answer.


Added a bounty: (how) can one use Aggregate target for simultaneous, multiple Build & Run? Perhaps one can achieve simultaneous, multiple Build & Run via some .sh script using xcodebuild? Any other possible solution?


Solution

  • UPDATE: Apple removed support for this type of plugin as of Xcode 8. AppleScript is probably your best bet.

    I ran into the same issue, so I wrote an Xcode plugin to help out with this. I found it to be more robust and easier to invoke than the AppleScript options.

    The plugin is called KPRunEverywhereXcodePlugin and is available via Alcatraz or on GitHub: https://github.com/kitschpatrol/KPRunEverywhereXcodePlugin

    New menu items

    Hope this helps!