Rahul Iyer
Rahul Iyer

Reputation: 20995

Xcode will run app on simulator but not on device

I receive the following error when trying to run the app on my device.

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

The app runs fine in the simulator. When I try to debug on the device, it appears to copy the app (I can see the icon), but then stalls with the above message. Xcode says it is running the app on my iPod, but nothing is happening on my iPod.

When I click on the app, the app appears to launch, but seems to be missing resources. Other projects of mine work properly. What setting do I need to change to make this work properly.? Looking at the error message, it seems to be looking in my mac for the app. But this doesn't make sense since I am trying to run it on my 4th gen iPod touch. I am using Xcode 4.3.1 and iOS 5.1

Upvotes: 52

Views: 67660

Answers (16)

Zhou Haibo
Zhou Haibo

Reputation: 2068

I get the similar question and has searched via the internet the whole day without solution yet...

Xcode 12, iOS 14.

I'm using a cocoaPods call GCDWebServer, which will open a build-in http service in iOS. Now it works fine in simulator and I could open a home page of it in my Mac's browser. But I cannot open the home page if running it with real iPhone. The browser said "Cannot connect to server"

And in console, everything is same without any errors provided for me. Thus, how could I debug this?

[DEBUG] Did open IPv4 listening socket 3
[DEBUG] Did open IPv6 listening socket 4
[INFO] GCDWebUploader started on port 80 and reachable at http://192.168.1.3/

Upvotes: 0

Siddhesh Mahadeshwar
Siddhesh Mahadeshwar

Reputation: 1611

For me it was Command Line Tools Go to Xcode -> Preferences -> Locations -> Command Line Tools

Make sure you select latest Xcode version. I selected Xcode 11.0, and everything started working.

Upvotes: 0

Lance Samaria
Lance Samaria

Reputation: 19572

I did these steps:

  1. Delete derived data: rm -rf ~/Library/Developer/Xcode/DerivedData
  2. Deep cleaned the project: Shift Key + Option Key + Command Key + letter K key
  3. Quit the project
  4. Quit XCode
  5. Deleted the app from my device

When I reopened the Xcode, launched the project, and then launched the app it successively ran on my device

Upvotes: 0

Juan Haladjian
Juan Haladjian

Reputation: 81

I solved this problem many times with DhilipSiva's solution. However, it may not work sometimes. If that is the case, consider deleting and re-adding the target.

Upvotes: 3

NathanChristie
NathanChristie

Reputation: 2400

With Mountain Lion and the latest version of Xcode (4.4.4F250), none of the suggestions in this thread worked directly (clean, clean project, remove derived data folder, etc). This sequence did. From DhilipSiva:

  1. Disconnect your device
  2. Delete the app from your device
  3. Quit Xcode (Don't just simply close the window, quit it)
  4. Delete derived data folder rm -fr ~/Library/Developer/Xcode/DerivedData (console)
  5. Start Xcode,connect device & run the project

Upvotes: 79

Sushil Mishra
Sushil Mishra

Reputation: 39

I solve this by going to Targets-> Info -> Required Device capabilities and check id at 0 index if armv7 not in 0 index then remove other things and armv7 set on 0 index and clean app connect device and run.

Hope this helps fine!

Upvotes: 0

Arthur Gevorkyan
Arthur Gevorkyan

Reputation: 2107

As Chronos mentiod, the device capabilities might be the reason. In addition I would say that in my case it was all about the UIRequiresPersistentWiFi key, which (for some unclear reason) didn't let me to install my app on an iPhone4. Hope this helps ones who tried everything else and haven't fixed the problem yet.

Upvotes: 1

Adrian Laubisch
Adrian Laubisch

Reputation: 11

I stumbled upon this same problem on several diferent projects, researched a lot on forums and even here on Stack overflow. A lot of solutions were given, and some people seemed to get them working, but none of them worked for me. So we tried some pretty obvious course of action, which for some reason we didn't tought about before: I've done a CHMOD -R 777 on the EXACT path indicated by the error message (I copied it directly).

Worked like a charm, 100% times!

Hope it helps, guys!

Upvotes: 1

pgb
pgb

Reputation: 25001

This error will manifest whenever the device capabilities described in the Info.plist do not match those of the device.

In my case, I was requesting GPS support and location-services support and trying to test on an iPod touch.

Upvotes: 4

parametr
parametr

Reputation: 1102

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.

No need to remove app from the device, clean project or restart/disconnect device. I think that's because Xcode and iTunes use some common libraries (as you know, Xcode Installer always asks to quit iTunes on installing iOS SDK).

Upvotes: 9

Wayne Shelley
Wayne Shelley

Reputation: 1032

Removed armv6 support and it started working again

Upvotes: 2

Peter Lakatos
Peter Lakatos

Reputation: 81

I also had this problem after changing from a lower XCode and iOS version to the current XCode and iOS version.

I fixed this problem by changing th iOS Depolyment Target to a lower version, since my Device is not updated to the latest iOS yet. You can do this by clicking the project inside the Info tab.

Upvotes: 7

Chronos
Chronos

Reputation: 1962

I solve this by going to Targets-> Info -> Required Device capabilities and delete the option with armv7.

Hope this helps!

Upvotes: 15

Bijoy Thangaraj
Bijoy Thangaraj

Reputation: 5546

I struggled with this problem for 2 days and went through all the posts, tried all the options including, restarting Xcode, device, deleting DerivedData folder etc.

Finally, the problem was with the Info.plist file. In my case, I had improper icon paths in the Info.plist file. I suggest you to archive the application and then validate it to get the exact problem in you case. Only when I did that, I was able to find the issue.

Upvotes: 3

Matthew Frederick
Matthew Frederick

Reputation: 22305

This is a recurring problem that many developers are having with the current version of Xcode. The temporary workaround has been consistently deleting the DerivedData folder.

You can add doing it to a build script or even make it a cron job:

rm -rf ~/Library/Developer/Xcode/DerivedData

Sad, but true.

Upvotes: 14

BrettS
BrettS

Reputation: 295

Have you looked at the Developer Certs and Distribution Certs if you have. When running in debug mode from Xcode your will need your app assigned with the developer cert and not the distribution cert. The distribution certs do not allow for debugging.

Upvotes: 4

Related Questions