How to add deleted frameworks again

前端 未结 4 1031
星月不相逢
星月不相逢 2020-12-10 04:28

I accidentally deleted AVFoundation , CoreFoundation , Foundation and UIKit.framework , CoreGraphics.frameworks frameworks form my Xcode. Is there any ways to restore them.

相关标签:
4条回答
  • 2020-12-10 05:05

    If you haven't emptied your trash, you'll find your frameworks there. In case the deleted frameworks are iOS frameworks just copy/move them back from your trash to your XCode frameworks directory, which would be the following for most installations to date (XCode 5 + iOS 7):

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/

    For OS X frameworks the path posted by 555nick may be the right one (haven't tested that though): /System/Library/Frameworks

    Btw: You can fast-open such paths by opening the finder and using the Shift+Cmd+G shortcut.

    0 讨论(0)
  • 2020-12-10 05:09

    Above method will not work if your xCode's location is different. For that Open xCode click top project blue icon. Click Target-> build Phases -> Link Binary With Libraries

    Now right or control click any existing framework and Show in Finder.

    This way you will get all existing framework's default location. Now go to that location and add your deleted framework again.

    Restart xcode then you will see your deleted framework as it was before.

    0 讨论(0)
  • 2020-12-10 05:14

    Ok. So if you have deleted the frameworks from finder as well as from trash here is a solution. If you have another version of xcode installed in your mac then open that. In any of your projects try to add any of the frameworks that you have recently deleted. right click on it and go to the finder window and copy it.

    Now go to the xcode from where the frameworks have been deleted, go to the fnder window in the same process above and paste the framework yoy just copied. i had the same problem as yours and it helped me.

    0 讨论(0)
  • 2020-12-10 05:26

    If you haven't emptied the trash yet, close Xcode and open the Trash in Finder. Find the framework folder you accidentally deleted. In Finder, open another window with the path /System/Library/Frameworks (beginning on Macintosh HD if you want to open the folder manually), and drag-copy the framework from the Trash to the Frameworks folder. Reopen Xcode and you should be able to add the framework again in the target settings.

    0 讨论(0)
提交回复
热议问题