MacOS app does not run on the Xcode simulator

XcodeMacos

Xcode 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 " (in the sidebar) > Info (tab). In here is a drop down box labeled Executable, select it and choose your app that you wish to launch when the Run button is clicked.

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: enter image description here

Solution 3 - Xcode

I had the same issue in late 2017 with Xcode 9.2.Uncheck 'Debug Executable'

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

Simple

Select the desired active scheme and device/simulator from the toolbar (next to the "play" and "stop" buttons).

The scheme selection should look something like below where the name is that of the appropriate target.

Set proper scheme and device/simulator.

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:

  1. Product -> Scheme -> Edit Scheme
  2. Run
  3. Info
  4. Executable -> Yourproject.app
  5. Run whole project again

Screenshot: enter image description here

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBasView Question on Stackoverflow
Solution 1 - XcodeChad MarmonView Answer on Stackoverflow
Solution 2 - XcodecardmagikView Answer on Stackoverflow
Solution 3 - XcodeJosiahView Answer on Stackoverflow
Solution 4 - XcodeOld McStopherView Answer on Stackoverflow
Solution 5 - XcodeWarren BurtonView Answer on Stackoverflow
Solution 6 - XcodeWill Von UllrichView Answer on Stackoverflow
Solution 7 - XcodeJerry ChongView Answer on Stackoverflow
Solution 8 - XcodeVladislavView Answer on Stackoverflow
Solution 9 - XcodekmiklasView Answer on Stackoverflow
Solution 10 - XcodeRob KenigerView Answer on Stackoverflow