升級了XCODE後,發現舊工程編譯後無法運行,出現:
"The selected destination does not support the architecture for which the selected software is built. Switch to a destination that supports
that architecture in order to run the selected software." 錯誤。
在網上搜尋半天找不到好的解決方式,即便是stackoverflow上。折騰了半天,最後換了關鍵詞搜尋,總算找到一個還算靠譜的解決方案,記下來希望能幫看到的哥們節省點時間。
文章地址在:http://hiediutley.com/2011/03/10/xcode4-is-your-old-project-hanging-in-the-simulator/
If you are having the same problem — deleting all the Xcode4 project data with your userid may get you up and running again…
How to go about deleting the user-specific project data
- In terminal – navigate to your project directory
- cd into the ${PROJECT_NAME}.xcodeproj directory
- run this command: find . -name ‘*yourUserName*’
- rm -rf any files or dirs that come up
- Reopen Xcode4 – build and *hopefully* run your project
簡單譯一譯:
如果你有同樣的問題,那麼刪除項目中所有的跟你的userid有關的檔案也許能讓你啟動它。
怎樣刪除使用者指定的專案檔呢?
1、在命令列中cd到你的工程檔案夾下
2、cd進xcode 項目的檔案夾,大致格式是:${PROJECT_NAME}.xcodeproj (註: 每一個xcode 項目其實是一個檔案夾。。你如果右鍵點擊專案檔會發現一個屬性叫:show package content,其實就是瀏覽它的內容。。)
3、執行這個命令:find . -name ‘*yourUserName*’ (註:把yourUserName替換成你的使用者名稱就行啦)
4、刪除列出的檔案。比如,我執行完find後出現如下檔案:
./project.xcworkspace/xcuserdata/kevin.xcuserdatad
./xcuserdata/kevin.xcuserdatad
於是我用rm -rf ./project.xcworkspace/xcuserdata/kevin.xcuserdatad 一個個把它們幹掉。
4、把xcode關掉(command+q徹底退出啊。。記得),然後重開。*希望*能運行吧。不行就只能再google了。。