Is it possible to build an xcode project for iPhone and have it install the result on a connected device without actually running the application? I'm currently using Build & Run, but I'm debugging a peer to peer game, so I have to build & run for two different devices, stop tasks on each of those and then build & run on the simulator so all three have the latest build. I'd love to not have to wait for the application to run on the two devices in this process.
4 Answers
You can drag and drop the built app (in your project build directory) into the Applications list of your device in the Organizer window.

- 11,695
- 7
- 41
- 50
-
1Nice! That's a bit faster than build and run and canceling twice. – typeoneerror Jul 05 '10 at 02:02
-
Really nice! I develop with external hardware and at times I need to see what happens when my app launches after a clean install (first time run) with an accessory attached. – MOK9 Mar 06 '13 at 00:09
-
This is really helpful for testing core data upgrade – lewis Aug 07 '14 at 01:16
-
1This is no longer the case. See this answer: https://stackoverflow.com/a/45800996/2420145 – simioliolio Aug 21 '17 at 15:38
Things have changed a little since this answer...
For simulator, you can drag/drop your recently-built app product from the Products folder in the Project Navigator straight onto the simulator window.
For a device, drag and drop the app product into "Installed Apps" when viewing the device in the "Devices" window.

- 209
- 3
- 7
If you're not quite sure where the built app is (the project build directory):
Xcode → Preferences → Locations tab → Derived Data will show the location.
There's more information in this question: Xcode 4 - build output directory

- 5,023
- 3
- 34
- 50

- 2,173
- 24
- 38
There's another way to get it to install automatically without launching. Maybe not as useful for the OP's situation, but in my case I'm trying to profile app load times so I want to start the app without the debugger attached (which can slow down execution.)
Under the target scheme, right click and select "Edit Scheme". Make sure the run configuration is selected, and then look in the info panel. There's an option that says "Launch" - set this to "Wait for executable to be launched."
Now once it's installed it will wait for you to launch the app before attaching the debugger. However, you can just hit "Stop" in Xcode and then launch the app manually. It seems to crash the first time but on second run seems to work OK. Maybe a little hacky but less manual steps than the other methods. Tested on Xcode 7.

- 5,450
- 3
- 32
- 30