20

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)
pgSystemTester
  • 8,979
  • 2
  • 23
  • 49
CodeGeek123
  • 4,341
  • 8
  • 50
  • 79
  • clean all build and then try again. – hchouhan02 Feb 27 '12 at 18:46
  • In past, with iOS, I've had problems with spaces in the file paths. – ry_donahue Feb 27 '12 at 21:34
  • Clean build doesn't work. Also some people have run this application on devices before so maybe that wouldn't be a problem? – CodeGeek123 Feb 28 '12 at 10:16
  • @CodeGeek123:First try restarting Xcode. If it doesn't work, then try hard reset of your device. This happens to me when I change the bundle identifier of my app. This solution,I found of the above problem its working fine for me.:) Link:http://stackoverflow.com/questions/10204686/error-launching-remote-program-no-such-file-or-directory/11761626#11761626 – Himanshu Agnihotri Oct 16 '12 at 09:46

12 Answers12

42

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.

Taryn
  • 1,670
  • 1
  • 15
  • 22
  • 9
    Just after deleting the "DerivedData" directory, it worked for me. Thx – geforce May 16 '12 at 09:35
  • Just deleting DerivedData and quitting and restarting XCode had not solved the problem for me, after which I decided to go for the both-barrels shotgun approach :) – Taryn May 23 '12 at 22:44
  • Clean the build, Quit XCode and start it up again – Pacu Jul 06 '12 at 22:57
  • Sigh! Got so far as rebooting the Mac and it just sits there, spinning. About 20 minutes so far. – Hot Licks Jul 29 '13 at 21:51
  • Forced power off and booted again -- the Mac came right up. (This is a new variation on flaky reboot behavior it's always has.) But "Could not launch", exactly as before. And earlier today I had no trouble building for a different iPad. – Hot Licks Jul 29 '13 at 22:10
11

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

Brian Laing
  • 111
  • 1
  • 3
  • 1
    likewise. simply deleting the folder did not work - even tho xcode would recreate it. – orion elenzil Sep 18 '12 at 19:59
  • Tried deleting derived data and restarting Xcode several times. – Hot Licks Jul 29 '13 at 21:29
  • I do note that if you delete derived data the Organizer immediately recreates it. Even if you go to Organizer, click the arrow next to the derived data, and delete from Finder, Organizer will immediately recreate it if you leave it open. Close Organizer and you can delete it using Finder. – Hot Licks Jul 29 '13 at 22:24
3

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.

bizi
  • 3,398
  • 2
  • 27
  • 28
2

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

barneymc
  • 490
  • 1
  • 5
  • 11
1

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

Sunil Targe
  • 7,251
  • 5
  • 49
  • 80
1

restarting the Mac fixes for me.

Ram G.
  • 3,045
  • 2
  • 25
  • 31
1

under /DerivedData: rm -r sampleproject

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

-> quit & relaunch XCode

it worked for me, hope it helps!!!

sonoshin
  • 241
  • 3
  • 6
1

Restart Xcode and it works again.

Wayne Shelley
  • 992
  • 10
  • 25
1

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
Berik
  • 7,816
  • 2
  • 32
  • 40
0

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.

Andru
  • 5,954
  • 3
  • 39
  • 56
0

Disconnecting the iPad and reconnecting it just worked for me.

0

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"?

Scott Corscadden
  • 2,831
  • 1
  • 25
  • 43