13

I have this jailbroken iPhone 3G with iOS version 4.2.1 (the latest supported version). When I connect it to Xcode 4.2, Xcode starts copying the debug symbols. It stops copying towards the end of the process, and shows the following error:

Xcode has encountered an unexpected error (0xC002)
No such file or directory, at ‘/SourceCache/DTDeviceKit/DTDeviceKit-867/DTDeviceKit/DTDeviceKit_Utilities.m:864’

Anybody experiencing anything similar?

I know I should try and restore the phone, but I'm asking just in case anybody can come up with a solution that doesn't involve restoring it.

In this post on mactechnews.de, one guy reports the same problem -- with no solution, so far.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Ricardo Sanchez-Saez
  • 9,466
  • 8
  • 53
  • 92
  • i'm also have the same problem. :( i'm running test builds via testflightapp.com on that device. but it still disallows me to debug app. – Evgen Bodunov Nov 20 '11 at 20:21
  • If your interested in this question why not support the Area 51 proposal for a [jail-breaking Stack Exchange site](http://area51.stackexchange.com/proposals/18154/ios-jailbreaking-development?referrer=EuWVi6IpN0_KzzEhC7I-Qw2) – Richard Stelling Jan 02 '12 at 14:21
  • 1
    definitely experiencing this issue, my guess is that it's an attempt to deter the fake code signing on Xcode 4.2 – lol Jan 04 '12 at 09:41

5 Answers5

29

Alright, after a lot of testing and digging up the filesystem... I solved it. It turns out that there are just a few files that are not downloaded from the device (for reasons still unknown). They are related to the dyld cache (don't really know what this is and what it's for). Here are the steps to make your 4.2.1 device debuggable in XCode 4.2 and 4.3.x:

  1. Close Xcode
  2. Go to: ~/Library/Developer/Xcode/iOS DeviceSupport/4.2.1 (8C148)/Symbols/System/Library/Caches/com.apple.dyld/
    Note: if you don't have this folder, run Xcode, connect your device, and wait until the error 0xC002 appears in Organizer - the folder should be created by that time.
  3. Create 3 empty files there called:
    • .copied_dyld_shared_cache_armv6
    • .processed_dyld_shared_cache_armv6
    • dyld_shared_cache_armv6
  4. Run Xcode and enjoy the light next to your device eventually go green:)

Or, for the terminal lovers:

cd ~/Library/Developer/Xcode/iOS\ DeviceSupport/4.2.1\ \(8C148\)/Symbols/System/Library/Caches/com.apple.dyld/
touch .copied_dyld_shared_cache_armv6
touch .processed_dyld_shared_cache_armv6
touch dyld_shared_cache_armv6


This is obviously a hack but it works perfectly for debugging and I haven't noticed any side-effects so far.
Enjoy!

Small update:
I tested it on my snow leopard hackintosh, with the Xcode 4.2 (most recent to date) and although the device is active in the organizer and it is possible to run the app on the device, i get black screen on launch. It gets installed but apparently debugger cannot get attached. I had the same problem with 4.0.2, when the 0xC002 problem didn't yet occur so I think it's unrelated and might even not happen to others. Nevertheless, 0xC002 is still solved.
On my main development machine with Lion and Xcode 4.3.2, device is perfectly debuggable.

Bartek Eborn
  • 524
  • 5
  • 12
  • I can't test it right now (my 3G is at home); but I'm marking this as the correct answer for now. Thanks! – Ricardo Sanchez-Saez Apr 02 '12 at 12:03
  • Thank you, I would be really glad to hear from you as soon as you test it, because this is my first Stackoverflow response and I'd like it to be at least correct :) – Bartek Eborn Apr 02 '12 at 18:41
  • Worked on my iPhone 3G. Thanks! – Yuvi May 10 '12 at 13:16
  • Worked for me using xcode 4.4.1 with a iPhone 3G with iOS 4.2.1 – Max B. Sep 06 '12 at 09:33
  • Worked for XCode 4.6 (4H127) with an iPod Touch 4G running iOS 6.0. Thanks! – Peter Feb 04 '13 at 07:13
  • @BartekEborn thank you for your solution. But I'm using Xcode 5.0 (5A1413) and iPhone 3GS with iOS version 6.0.1(10A523). And appeared such error in Organizer. Can you give solution for this situation. Or it is same for all kind of iPhone and Xcode? thanks. – Shamsiddin Saidov Oct 08 '13 at 08:34
  • @ShamsiddinSaidov Have you tried yourself first? I have neither 3GS nor XCode or even a Mac somewhere near now. As you see, people in comments were testing it using different Xcode/iOS/iPhone combinations and usually it worked. I don't follow recent changes but I guess Apple might have dropped support for 6.0.1 in XCode 5.0, so analogically, I would try in Step 2 going to: ~/Library/Developer/Xcode/iOS DeviceSupport/6.0.1 (10A523)/Symbols/System/Library/Caches/com.apple.dyld/ and proceeding with the other steps, obviously creating files with armv7 at the end instead of armv6 in step 3. – Bartek Eborn Oct 09 '13 at 09:01
  • Oh, Bro I solved my problem :). By connecting another not jailbroken iPhone. When I connected second one. There created some folders in ~/Library/Developer/Xcode/iOS DeviceSupport/6.0.1 (10A523)/Symbols/System/Library/ and one file(dyld_shared_cache_armv7) in ~/Library/Developer/Xcode/iOS DeviceSupport/6.0.1 (10A523)/Symbols/System/Library/Caches/com.apple.dyld/. Then I connected my problematic iPhone and it worked :) – Shamsiddin Saidov Oct 09 '13 at 12:55
  • Unbelievable that this is still working in year 2020! – Lumi Wang Feb 06 '20 at 13:38
7

The answer above (https://stackoverflow.com/a/9944892/1390251) works, basically, but for newer versions of Xcode you probably need to rename the files as follows, having them end with '7' instead of '6':

touch .copied_dyld_shared_cache_armv7
touch .processed_dyld_shared_cache_armv7
touch dyld_shared_cache_armv7

If not sure, you can keep both sets of files (...6 and ...7) in the relevant folder (can also be 5.1.1 for that matter) and it should work. (have tested it on iPhone 4 with iOS v5.1.1 genuine)

Community
  • 1
  • 1
Gonen
  • 4,005
  • 1
  • 31
  • 39
1

It seems that you cannot debug apps on iOS 4.2.1. I tried several restores to iOS 4.2.1 with same effect. Downgrading to iOS 4.0 was the only thing that worked.

The reason for whole problem is that iOS 4.2.1 is not supported in XCode, according to this website.

NiVi
  • 11
  • 2
1

Error in Xcode getting debugging info from 5.0.1 iphone solved, see the link to archive with iOS5.0.1 debug info download & unpack to "~/Library/Developer/xCode/iOS DeviceSupport/" & be happy =)

Community
  • 1
  • 1
iGore
  • 11
  • 1
0

I fixed this bug in![enter image description here][1] this way:

I duplicate the 5.1.1(9B206), rename it to 5.1.1(9A405)[my ios device is this version], then the error is gone.

Lugede
  • 11
  • 1