MacOS app does not run on the Xcode simulator
XcodeMacosXcode Problem Overview
I've installed Xcode 4.2.1 on Mac OS X Lion.
When I create a new (Mac OS X Cocoa) project and I click "Run", Xcode says build succeeded, but doesn't run the project. No errors, but no application either.
When I do exactly the same thing on another Mac (but with OS X Snow Leopard and Xcode 4.0.1 installed), the created app starts bouncing in the dock and shows an empty window, like I would expect.
When I look in the Console, there seems to be nothing strange going on. I tried reinstalling Xcode, deleting everything related to Xcode, but still no luck.
Anyone got an idea what could be the problem?
(I tried running an existing project which used to work, but that didn't show anything either)
Thanks.
Xcode Solutions
Solution 1 - Xcode
I had a similar problem with Xcode 4.5.2.
To fix it I had to go to the menu Product > Edit Scheme... > Select "Run
Solution 2 - Xcode
I messed up my settings and had this same issue - builds the app but doesn't launch (either in the simulator or the device).
The answer Product > Edit Scheme got me half way there - then choose Run {your app} on the left. There is a launch Automatically radio button to check:
Solution 3 - Xcode
I had the same issue in late 2017 with Xcode 9.2.
I had to uncheck 'Debug Executable' and then my app was able to both run and stop.
You can open the settings by clicking Product -> Scheme -> Edit Scheme...
Solution 4 - Xcode
Select the desired active scheme and device/simulator from the toolbar (next to the "play" and "stop" buttons). Simple
The scheme selection should look something like below where the name is that of the appropriate target.
Solution 5 - Xcode
Check if your project has entitlements enabled. Sandbox or iCloud or both.
If you have that enabled and you dont have an appropriate cert from the Dev portal your app will build but not launch.
Switch the entitlements off if you are not actively developing functionality around them.
The Console app will show this up as a permissions failure. But oddly not the Xcode debug console.
Solution 6 - Xcode
I know this is a well accepted answered question, however for those who are building / running on a physical device
SOLUTION: Hard-restart the device, then clean the project in Xcode ⇧+⌘+K.
I think the bundle gets confused causing Xcode to "think" it already ran the project, therefore showing "Finished" instead of launching whichever application you selected to run.
Solution 7 - Xcode
Xcode 10.2
Steps:
- Product -> Scheme -> Edit Scheme
- Run
- Info
- Executable -> Yourproject.app
- Run whole project again
Solution 8 - Xcode
I had similar problems. I found that the problem was in ~/.gdbinit file. And a second time - at the window initialization function loadWithNibName/initWithWindow (wrong name nib file or frame properties). Also check the file Info.plist in your project (parameters "Main nib file base name" and "Principal class").
Solution 9 - Xcode
Do you have the correct project selected to run?
Click on the project name next to the stop button (top left). Are there multiple projects listed? Do you have the correct one selected?
Solution 10 - Xcode
Try removing the dev tools by running
sudo Developer/Library/uninstall-devtools --mode=all
in Terminal. This will properly remove all components of the dev tools, including the command-line components.
You can then try a re-install.