CodeGeek123
CodeGeek123

Reputation: 4501

Error : failed to launch, when running on ipad

After much frustration I've finally got an application to run on an iPad without errors. However it doesn't run. It gives the following error. My application does run on the simulator but doesn't run on an iPad and gives the below error. I'm really not sure why. I went to the described folder the structure of the folder is as follows.

Products
 .DS_Store
  Debug-iphoneos
   .DS_Store
    sampleproject.app
    sampleproject.app.dSYM
  Debug-iphonesimulator
   .DS_Store
    sampleproject.app
    sampleproject.app.dSYM



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

Upvotes: 20

Views: 12918

Answers (12)

Monica Guimaraes
Monica Guimaraes

Reputation: 1

Disconnecting the iPad and reconnecting it just worked for me.

Upvotes: 0

Andru
Andru

Reputation: 6194

It happened to me using Xcode 7.1.1 with OSX Yosemite.

Followed all steps of @tarryn (the accepted answer) but did not restart my mac. Restarting the mac eventually solved the problem for me.

Upvotes: 0

Berik
Berik

Reputation: 8143

Another cause of this problem

Selecting the wrong mobileprovisioning profile. For example you can have a Distribution profile selected in Debug mode, Xcode will then not allow the app to start in debug mode.

To fix this

  • Select your project file in Xcode
  • Choose "Build Settings"
  • Search for "code signing"
  • Confirm that a Development profile is selected for "Develop" builds

Upvotes: 1

bizi
bizi

Reputation: 3457

Following Tarryn's suggestion to delete DerriveData leads to another problem "No Code Sign found", which brings my attention to the Code Sign section in my Build Setting. The Code Sign for Debug is set to "Don't Allow". Changing it back to my iOS developer profile solves the issue.

If anyone gets this problem and follow the path Tarryn suggested, there is one more step you can try to work this out.

Upvotes: 3

Wayne Shelley
Wayne Shelley

Reputation: 1032

Restart Xcode and it works again.

Upvotes: 1

sonoshin
sonoshin

Reputation: 241

under /DerivedData: rm -r sampleproject

-> disconnect ipad -> reboot ipad -> reconnect ipad

-> quit & relaunch XCode

it worked for me, hope it helps!!!

Upvotes: 1

Ram G.
Ram G.

Reputation: 3125

restarting the Mac fixes for me.

Upvotes: 1

Sunil Targe
Sunil Targe

Reputation: 7459

Firstly quite the Xcode and restart, it'll run finely..

Upvotes: 1

Brian Laing
Brian Laing

Reputation: 111

Deleting the DerivedData directory and restarting Xcode worked for me. Simple restart of xcode did not.

Upvotes: 11

barneymc
barneymc

Reputation: 490

Very frustrating, but in the end a simple exit XCode and restart XCode seemed to clear the issue.

Upvotes: 2

Taryn
Taryn

Reputation: 1700

Just had the same error on Xcode 4.3.2, with target iPad3 5.1, but was able to build and run on my device after these steps:

  Deleted my DerivedData directory (emptied trash too)
  Quit XCode
  Disconnected iPad USB
  Rebooted Mac
  Rebooted iPad (power down and back up)
  Reconnected iPad USB.
  Restarted Xcode with project
  Confirmed build for debug on device selected.
  Clicked Run

I've no idea whether all these steps are mandatory. This is a crummy answer, since it neither explains the problem, nor offers a sure fix. I expect better of Apple; I've looked for a better answer, but found nothing.

Rebooting to solve problems is no solution! OTOH, it let me proceed on with my work, so...a small blessing.

Upvotes: 42

Scott Corscadden
Scott Corscadden

Reputation: 2860

It sounds like the target is not necessarily set up correctly. What is the name of the Target? I see "Virgin Atlantic" there, but the project root is "sample project"?

Upvotes: 0

Related Questions