简体   繁体   English

恢复XCode中的项目设置

[英]Restore Project Settings in XCode

How can I restore Xcode project settings? 如何还原Xcode项目设置? I can't see few settings (like Targeted Device Family, iPhone OS Deployment Target, etc.) after I gave my Macbook to my friend. 将Macbook交给朋友后,我看不到很少的设置(例如“目标设备系列”,“ iPhone OS部署目标”等)。 :( :(

I also saw that the info.plist file was not in the project, I recovered it via TimeMachine though, the Base SDK is also missing. 我还看到info.plist文件不在项目中,尽管我也通过TimeMachine恢复了它,但是Base SDK也丢失了。 :( She messed all things up, I don't know why she went in there. Anyways, is there any way to restore the settings? :(她搞砸了所有事情,我不知道为什么她要去那里。无论如何,有什么办法可以恢复设置吗?

Unfortunately, the snapshot that I have is also very old. 不幸的是,我拥有的快照也很旧。 :( :(

No way to restore them. 无法恢复它们。 You can set the base sdk on the project info screen. 您可以在项目信息屏幕上设置基本SDK。

Project > Edit Project Settings > Base SDK, Check the same for your Target. 项目>编辑项目设置>基本SDK,对您的目标进行检查。

Is this issue occurring for a specific project, or all projects? 是针对特定项目还是所有项目都发生此问题? If you create a new project, what happens? 如果创建一个新项目,会发生什么?

I forget the exact syntax, but different versions of XCode handle project files slightly differently. 我忘记了确切的语法,但是不同版本的XCode处理项目文件略有不同。 A new SDK (and version of XCode) couldn't read my project file right (same symptoms you explain). 新的SDK(和XCode版本)无法正确读取我的项目文件(您解释的症状相同)。

In my case, there were 2 different SDK settings in the project file due to 2 separate versions of XCode editing the file (this could be very likely if you restored from backup and had upgraded SDKs in the interim). 在我的情况下,由于有两个不同版本的XCode编辑文件,因此项目文件中有2种不同的SDK设置(如果您从备份中还原并在此期间升级了SDK,则很有可能)。

Look for something like: 寻找类似的东西:

 SDKROOT = iphoneos4.2;

Or really, just look around the text that contains the build settings (all of your build settings are stored in the file in flat text) -- you may see something related to SDKs where there are 2 lines very similar right next to each other. 或者说真的,只是环顾包含构建设置的文本(所有构建设置都以纯文本格式存储在文件中)-您可能会看到与SDK相关的内容,其中有两行彼此非常相似。 That'd probably be your problem. 那可能是你的问题。 If you don't know which to delete, try both and then re-set the setting using the interface. 如果您不知道要删除哪个,请尝试两者,然后使用界面重新设置。

Of course in any case, you should back up your project file ( project.pbxproj ) before trying any of this. 当然,无论如何,您都应先备份项目文件( project.pbxproj ),然后再尝试执行任何此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM