如何告诉 Xcode 我的 info.plist 和. pch 文件在哪里

我重命名了我的项目和它的文件,现在 Xcode 仍然在寻找旧的 info.plist 文件。在哪里设置。普利斯特和。它需要的 pch 文件。

在“项目信息”窗口中,在“打包”下有一个“信息”项。普利斯文件,但它是空白的,当我尝试不同的路径,什么也没有发生。在编译时,它仍然说它无法找到旧名称的 plist。

63600 次浏览

Found it. It was in the settings for the Target.

  • Choose Target in the Groups and Files pane on the left.
  • Right-Click and choose Get Info
  • Search for "Info.Plist" and type in the filename for the correct plist file into the property of the item named "Info.Plist File".
  • Then search for "Prefix" and find the item named "Prefix Header".
  • Change it's property to the name of the correct .pch file that you are using.

I think these different "Info" windows are confusing. You have to make sure the right file is selected in the Groups and Files pane before selecting "Get Info", and it's hard to tell if what you're doing is actually making changes to the Info.plist file, or where your changes are being saved.

I know this answer is answered and closed, but I'm going to add my discoveries here as it is slightly different for Xcode 4.2:

  • Select your project
  • In the left side of the middle pane, select your app under "Targets"
  • Select the tab "Build Settings"
  • Search the following keywords: "info.plist" and "pch"
  • At this point it should be pretty clear which are the ones you need to modify.
  • Click on "Validate Settings" and you're done.

One more wrinkle to this. It still would not find the new plist file because it was in a folder inside the main project hierarchy on my disk. In this case, the name you should put in the build settings is relative to the project file, like "FolderName/Info.plist" for example.

I know this is an old post, but I just ran into this same problem using Xcode 8.2. I had already duplicated .plist and .storyboard files in finder, but my Xcode project did not pick them up. In order to add files to your xcodeproj just right click on the project or folder in the Project Navigator and select Add Files to "Your Project Name". You should be able to select the files you need (use Cmd key to select multiple individual files).

If you created a new .plist or .storyboard file you'll need to link to your target membership. To link just click on the file in the navigator and on the right hand side in your standard editor > file inspector > target membership select the appropriate target membership.

The correct way to do this without duplicating files in finder is by selecting the file to duplicate and then going to File > Duplicate on the Xcode navigation menu.

I am working with Xcode 9.3 and "boldly" changed my app name without understanding that I was inviting trouble: I got it.

Fortunately, it is now easy to rename a project or app with reliable results if in Xcode you select the blue icon on the left/in the project navigator and then edit the "Identity and Type" "Name" field in the "File Inspector". This brings up a dialog, and clicking on "Rename" works reliably.

For Xcode 10.1 when rename or move info.plist to sub folder.

  • Select your project
  • Choose targets
  • In General tab under Indentity you can specify new info.plist file

Just close project and reopen it. Then you will see on the project target, choose plist button on the General tab See this screenshot to make sense

From XCode 11 onwards, the updated path for Info.plist has to be changed under Target -> Build Settings -> Packaging -> Info.plist File.

Please read here for further details

Xcode 14

Chose your Targets -> Build Settings -> Packaging Find key "info.plist File" and update path like "AppName/FolderName/Info.plist"

enter image description here