73
votes

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.

10
What have you got as your Base SDK?jbat100
Latest Mac OS X (Mac OS X 10.7)Bas
Does Xcode appear to be running the app (e.g., Stop button becomes enabled)? Which debugger are you using?Peter Hosey
I edited the preferences so that Xcode shows a bezel alert when the Run starts. That shows up every time I click "Run", and the "Stop" button becomes enabled. I'm using the debugger "DWARF" and on Release it says "DWARF with dSYM File".Bas
@Basibo1: That's not the debugger, that's the debug symbols format. The debugger setting is in the scheme.Peter Hosey

10 Answers

254
votes

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.

8
votes

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

5
votes

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...

3
votes

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.

1
votes

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.

1
votes

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.

1
votes

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

0
votes

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").

0
votes

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?

-1
votes

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.