問題描述
我有這款 iOS 版本 4.2.1(支持的最新版本)的越獄 iPhone 3G.當(dāng)我將它連接到 Xcode 4.2 時,Xcode 開始復(fù)制調(diào)試符號.它在進程結(jié)束時停止復(fù)制,并顯示以下錯誤:
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?
我知道我應(yīng)該嘗試恢復(fù)手機,但我只是想以防萬一有人想出不涉及恢復(fù)的解決方案.
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.
在 mactechnews.de 上的這篇文章,一個人報告了同樣的問題——到目前為止還沒有解決方案.
In this post on mactechnews.de, one guy reports the same problem -- with no solution, so far.
推薦答案
好吧,經(jīng)過大量測試和挖掘文件系統(tǒng)...我解決了.事實證明,只有少數(shù)文件沒有從設(shè)備下載(原因仍然未知).它們與 dyld 緩存有關(guān)(不知道這是什么以及它的用途).以下是使您的 4.2.1 設(shè)備在 XCode 4.2 和 4.3.x 中可調(diào)試的步驟:
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:
- 關(guān)閉 Xcode
- 轉(zhuǎn)到:
~/Library/Developer/Xcode/iOS DeviceSupport/4.2.1 (8C148)/Symbols/System/Library/Caches/com.apple.dyld/
注意:如果您沒有此文件夾,請運行 Xcode,連接您的設(shè)備,然后等待管理器中出現(xiàn)錯誤 0xC002 - 屆時該文件夾應(yīng)該已創(chuàng)建. - 在那里創(chuàng)建 3 個空文件,名為:
.copied_dyld_shared_cache_armv6
.processed_dyld_shared_cache_armv6
dyld_shared_cache_armv6
或者,對于終端愛好者:
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
這顯然是一個 hack,但它非常適合調(diào)試,到目前為止我還沒有注意到任何副作用.
享受吧!
小更新:
我使用 Xcode 4.2(迄今為止最新版本)在我的雪豹 hackintosh 上對其進行了測試,盡管該設(shè)備在管理器中處于活動狀態(tài)并且可以在設(shè)備上運行該應(yīng)用程序,但我在啟動時出現(xiàn)黑屏.它已安裝,但顯然調(diào)試器無法連接.我在 4.0.2 中遇到了同樣的問題,當(dāng)時還沒有發(fā)生 0xC002 問題,所以我認(rèn)為它是不相關(guān)的,甚至可能不會發(fā)生在其他人身上.盡管如此,還是解決了 0xC002.
在我使用 Lion 和 Xcode 4.3.2 的主要開發(fā)機器上,設(shè)備是完全可調(diào)試的.
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.
這篇關(guān)于Xcode 4.2:嘗試使用越獄的 iPhone 3G 進行開發(fā)時出現(xiàn)錯誤 0xC002的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!