82

I ran into problem with testing my app on iOS and Xcode when I am uploading it to my actual devices (iphone and iPad), and I'm wondering if someone knows the issue and can help me out:

Normally when I build my app on my devices, the app is installed and launched on my devices. But as I am preparing for submitting my first app I was testing around and changing the Bundle Identifier, App ID, and Development Provisions (so the issue may have something to do with it), and now, when I try to build my app on my devices, although it's installed on my devices fine, Xcode will not launch the app anymore. Instead, I got this error message:

Error Starting Executable. Error launching remote program: No such file or directory.

Does anyone know what the issue is? And What is this derived data folder about?

Much thanks!

JustSid
  • 25,168
  • 7
  • 79
  • 97
JusmanX
  • 961
  • 1
  • 7
  • 6

15 Answers15

125

I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.

crazywood
  • 1,455
  • 1
  • 10
  • 17
  • I had to [kick the nuclear reactor in my city](http://stackoverflow.com/a/7354557/111307) to get mine to work. – bobobobo Sep 24 '12 at 03:28
89

Running App from a Clean Slate

For me the problem did not resolve until I did the following in this order:

  1. Delete the app from the device (Do this before trying to debug again)
  2. Quit XCode (Don't just close the project)
  3. Delete the app build folder (example path: /Users/myusername/Library/Developer/Xcode/DerivedData/MyProject-fhkaamuyvqhubaezinqbmxbnaufd/)
  4. Restart XCode
  5. Finally -- Try debugging again on the iOS device

The app build folder of step 3 refers to your app's build folder that is a child of "DerivedData". To find this you can reveal your app in finder, then backtrack until you get to "DerivedData" folder and delete the folder above that like "MyApp-crazylongweirdletters". Without this step (3), I could not debug, so this is a critical step and you must quit XCode before you do this step.

For some it appears simply restarting XCode does the trick, but not for me.

I only post this answer because the earlier answers did NOT work for me. Hopefully others banging their heads will find this and get a sigh of relief. :)

Notes:

  • The issue started happening for me when I modified the bundle id of the app.
  • My code signing is and was correct. My provisioning profile was the "Team Provisioning Profile" which should work for any app id (default for "iPhone Developer" automatic profile selector).
  • I was doing a DEBUG build (not release / distribution).
Sam
  • 26,946
  • 12
  • 75
  • 101
  • 5
    This worked for me. Just make sure that you QUIT XCode instead of just closing the project. – Jorge Garcia Sep 15 '11 at 07:58
  • 1
    This started happening to me too and this fixed it - seemed something to do with me having to renew my distribution cert – Simon East Mar 13 '12 at 15:10
  • 1
    This also worked for me where quitting Xcode and deleting the app from the device did not. I was able to run the app from the device, just not with the debugger. – Wil Macaulay Mar 27 '12 at 03:14
  • 2
    The recommended answer didn't work for me but this worked a charm! Just to clarify for anyone reading it, to find the build folder in Xcode click on your app in the file list view in window and 'show in finder'. – sradforth Jul 02 '12 at 08:36
  • 1
    [He's nobody's hero..](http://www.youtube.com/watch?v=PDJwu2rugG0) --(just the chorus) this answer deserves the checkmark ! – bobobobo Sep 24 '12 at 03:26
  • At my app, the trouble began, when changing the "Product Name" in build settings. When I changed it back to the old settings, I was able to compile and run on sim and device. – nodepond Nov 20 '12 at 15:33
  • Remember to quit emulator completely and also delete the app, otherwise it won't run on the emulator when launched from xcode, after the bundle id is changed – Echo Lu Mar 09 '13 at 07:27
  • Solved by doing all that + restarting computer – RelativeGames Jun 07 '12 at 21:44
  • I had this problem with a native OSX app, and deleting the build folder did the trick for me. –  Aug 25 '15 at 01:26
10

You cant debug (start from Xcode) an application signed with a distribution profile if I remember well... And then you get such messages, gdb failling to attach to process.

Vincent Guerci
  • 14,379
  • 4
  • 50
  • 56
  • Hi vincent!even i had built my application using developer profile,still am facing the same issue. – ravoorinandan Aug 02 '11 at 05:30
  • 1
    @ravoorinandan Try my solution (close XCode, delete your app build folder, then open XCode and try debugging. Probably also good idea to delete your app before running. This had me banging my head for while before I tried these steps. If this works for you, please vote my answer up (not just this comment). – Sam Sep 08 '11 at 21:13
8

I finally found my error!

I was playing around with my info.plist file, and I changed the Executable Name and Bundle and Bundle Display name! As soon as I changed those back to the Defaults (EXECUTABLE_NAME, PRODUCT_NAME, PRODUCT_NAME respectively) it worked perfectly.

sridvijay
  • 1,526
  • 18
  • 39
  • 3
    I had an issue with my plist that was also causing the same problem. Make sure you double-check your plist you guys! Thanks for the tip! – Ethan Allen Sep 13 '12 at 23:18
4

Delete the app from the device (tap-and-hold then delete) and try again.

Asem H.
  • 743
  • 3
  • 7
  • 16
3

For me, none of those worked. Same error, but different solution.

My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.

The fix was simple - drop the deployment target to below or equal to the ios software version on my phone :)

Jarrod
  • 9,349
  • 5
  • 58
  • 73
2

I got the same error by not having my code signing correct.

Go to your project > Targets > Build Settings > Check code signing for debug state.

RyanJM
  • 7,028
  • 8
  • 60
  • 90
1

I stumbled upon this as a solution to another issue whch was a warning when trying to build an app on a new 4.3.5 device.

If i set the profile to distribution I do not get a warning message when building the app, but the debugger will attach to the device.

If i set the code signing to the distribution profile, i get no warnings in the build process, but the debugger will not attach. So the answer above about being signing based seems to be correct. This might also only be an issue on newer 4.3.5 devices with xcode

bruce
  • 13
  • 2
1

Product -> Clean in the menubar

Alex Zielenski
  • 3,591
  • 1
  • 26
  • 44
1

I have the same problem. I solved it by changing the project's directory name and then launching the app again.

Nightfirecat
  • 11,432
  • 6
  • 35
  • 51
Emad
  • 11
  • 1
1

This error some times happen due to incomplete "Restore" or "Sync" process of your device which keeps the .app files locked up.

What I did I had to jailbreak my device to go find the app under /User/Applications/XXXXX-XXXX-XXX/ and phisically delete the .app

For one of the apps it worked and for other one I realized it just does not run GDB automatically so the error message is totally misleading, so I set the GDB to manual and it worked and did not give me that error, but of course I have to run the app manually for the debug session to start.

It also may have required some other stuff that I did before like checking the provision profile, but this was the last step that made it work.

Before this I tried all the solutions did not work for me, and obviously simply deleting the app by holding down your finger on the screen did not work, as it removed the icon but all the files were still there. ( Since it was a development app not a downloaded App Store app )

Rhm Akbari
  • 362
  • 3
  • 12
  • You tried my solution and it didn't work? I know personally I would not want to jailbreak my device – Sam Mar 14 '12 at 16:25
  • Yes I did try your solution, and many more, the problem was with an incomplete backup which just killed the development app icons on the spring board. – Rhm Akbari Mar 16 '12 at 20:41
1

had same problem, quit the XCode...delete app from device...run the program again.. i solved that way..one of my friends had to restart the device.

EarlySun
  • 185
  • 2
  • 12
0

I've faced this issue since yesterday on two different devices, both iOS 4.x. Deleting the DerivedData folder, deleting the app, restarting the Xcode, and cleaning the code did NOT work. Repeating all the steps, in addition to rebooting the device fixed it for me.

Neeku
  • 3,646
  • 8
  • 33
  • 43
0

Here I am posting an update to the issue. Might be helpful for someone with the same problem. I have Xcode 4.4 and launched it on a device with iOS 5.0 . If Xcode doesnt have the 5.0 simulators

Nareshkumar
  • 2,331
  • 2
  • 20
  • 30
0

I had this problem on a recently restored device where my in-development apps had not been reinstalled—they were showing up on Springboard as "Waiting" to be downloaded from the App Store. Deleting the app from Springboard fixed the problem.

Becca Royal-Gordon
  • 17,541
  • 7
  • 56
  • 91