14

When i try to launch my application from Xcode to the device, i get this error:

error: failed to launch '/Users/Luca/Library/Developer/Xcode/DerivedData/myapp-bmsyknqfiyjuechenbmjnbfmpnsn/Build/Products/Debug-iphoneos/myapp.app/myapp' -- No such file or directory (/Users/Luca/Library/Developer/Xcode/DerivedData/myapp-bmsyknqfiyjuechenbmjnbfmpnsn/Build/Products/Debug-iphoneos/myapp.app/myapp) 

I am using Xcode 4.3.2 and iOS 5.1 for my iPhone.

12 Answers 12

32
  1. Disconnect your device.
  2. Delete the app from your device.
  3. Quit Xcode completely.
  4. Go to ~/Library/Developer/Xcode/DerivedData and look at the folders there ($ ls).
  5. Find the one with the app's name in front of it and delete the folder ($ rm -rf ).
  6. Reopen Xcode.
  7. Connect your device.
  8. Build and Run the app (cmd + R).
  9. Boom.
Sign up to request clarification or add additional context in comments.

2 Comments

No need to clear the derived data manually - Xcode Organizer Window has an option for that (Projects->). Nevertheless, this is a step (manually or within Xcode) that often does wonders.
@Till Do you mean Product->Clean menu item in XCode 5.1.1? Or something else? There isn't a Projects menu in XCode 5.1.1 at least, and right-click on the Project itself doesn't appear to have a Clean/Clear Derived Data option.
19

Clean your application folder and rebuild it

1 Comment

Restarting XCode is a necessary part of this process.
10

Cleaning, quiting XCode, relaunching XCode and recompiling helped me with an indentical issue.

Comments

2

I also ran into this problem compiling a Cocos2D project on an iPhone 4. That was after having followed all the steps suggested by Jeff Grimes but to no avail. Everything had been working fine, so I was a bit stumped.

The fail was a caused by change of the UIRequiredDeviceCapabilities for accelerometer from YES to NO (as the app isn't using accelerometer I decided to just drop the requirement). I changed it back and everything is fine - compiling again.

Incidentally - I thought that changing the value of the key to NO meant that the accelerometer would just not be required. This is wrong - this breaks the compiler as it checks to make sure the device has NOT got an accelerometer, which of course returns true for most devices. So you just need to delete that row entirely if you don't need accelerometer support.

1 Comment

For me works removing the UIRequiredDeviceCapabilities specification. Thanks!
2

I encountered this problem when I tried to run my app on a device with an iOS version below the deployment target set in Target->Summary->Deployment Target. The deployment target was set to 6.0 and my device had iOS 5.1 . Changing the Deployment Target to 5.1 fixed it for me.

Comments

1

For me restarting of Xcode, cleaning DerivedData and restaring device wasn't enough in most cases, until I had figured out that iTunes was also running, and after quitting iTunes everything worked fine!

So my steps now are simple:

  1. Quit Xcode.
  2. If iTunes is running, quit iTunes.
  3. Reopen project.

It works without cleaning and device restarting.

Comments

1

I have the same problem. In my case, I just upgraded the iPhone from iOS 6.1 to iOS 7.0.4. I can install the app from Xcode 5 onto the device but it could not be launched. I did a lot the above suggestion in disconnecting, removing app, remove folder and restart Xcode. It still could not work, until I reboot the iPhone. After restarting iPhone, I repeat the above and now it works.

1 Comment

After restarting iPhone ,ipad**** good information. thank you
1

I just wanted to add one more tip to prevent this from happening:

DO NOT detach your physical device before you hit the stop debugging button from xCode. This is actually the most common case after which I met the "could not launch" issue. In my case, 80% of the issue is caused by this... just accidentally detached the device during debugging...

Keep in mind. :P

Comments

0

Sometimes it helps disconnecting the device and plug it again

Comments

0

I too faced this problem. I tried with options which were listed above.

But in my case problem was the device having iOS version 6.0 and the build target was set to 6.1. Version of simulator is iOS 6.1 so it is running on simulator but on phone it failed to install.

After changing the build target version it executed and installed on device

May this will help...

--Avinash

Comments

0

The only way I was able to fix this was to hard-boot my iPhone (hold down power and menu button until it powers off) and restart Xcode.

Comments

0

Try this:

Edit Scheme -> Info -> Executable -> Ask on launch

Then run and choose the executable for your app

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.