user1103804
user1103804

Reputation: 157

Xcode error: failed to launch

I have a Mac app I have written to support iCloud. However, I get this when trying to run the app:

error: failed to launch /Users/padsoftware/Library/Developer/Xcode/DerivedData/Scrawl-heofvoywsunchdhjowxkvkoiqvan/Build/Products/Release/Scrawl.app/Contents/MacOS/Scrawl

The odd thing is that this appears for all of my Mac apps, with or without iCloud, with or without sandboxing, with or without entitlements, or ever with or without code signing. Any idea on how to fix this?

Upvotes: 10

Views: 20232

Answers (7)

shreddish
shreddish

Reputation: 1774

What worked for me... I was already code signed as developer so I cleaned my code menu bar -> Product -> Clean

That still didn't fix it but I noticed that I was getting handshake error, I had a large amount of apps already running on my phone (~15-20) so I exited out of all of them and retried. It worked after exiting out of all other apps.

Upvotes: 0

gail
gail

Reputation: 21

"Product"->"Scheme"->"New Scheme" fixed my problem

Upvotes: 2

jowie
jowie

Reputation: 8068

Just in case it helps anyone else, my problem was fixed by rebooting my iPhone (4S). Then the app suddenly appeared on the Springboard (it was like it was already installed but somehow hidden).

...I did all the other steps (restart Xcode, clean project, delete derived data) but none of it worked this time.

Upvotes: 0

an yu
an yu

Reputation: 481

I encounter this problem every once in a while. Like the others mentioned, these are the steps I take:

1. Clean (Shift+Cmd+K) ------ Removes all the product files, as well as any object files (.o files) or other intermediate files created during the build process (Apple Doc)

2. Navigate to "~/Library/Developer/Xcode/DerivedData", delete folder for app in question ------ Derived data consists of project indexes, logs, and build products including intermediate files (Apple Doc)

3. Restart Xcode

One or the other usually fixes it. I haven't had to change Code Signing settings, but that would be my next step. Wouldn't re-install Xcode unless absolutely necessary.

Upvotes: 6

M.Othman
M.Othman

Reputation: 5300

I had such problem also and restarting Xcode Fixed the issue .

even it happened after renaming the application ....

Upvotes: 3

Andy
Andy

Reputation: 14302

I had this problem too. For me, it was a code sign issue. Make sure you're signing with developer, not distribution.

Upvotes: 26

Samatron
Samatron

Reputation: 21

  1. Under Build Settings make sure you are signing with a valid developer profile for debug and release.
  2. Then Build for Testing

That fixed the problem.

Upvotes: 2

Related Questions