Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Xcode where my info.plist and .pch files are

Tags:

xcode

I renamed my project and it's files and now Xcode is still looking for the old info.plist file. Where do I set the locations of the .plist and .pch files that it needs.

In my Project Info window, under Packaging there's an item for Info.Plist file, but it was blank, and when I try different paths, nothing happens. On compile it still says it can't find the plist by the old name.

like image 436
Andrew Avatar asked Nov 11 '10 20:11

Andrew


People also ask

Where are plist stored in iOS?

plist . This name of this file is case sensitive and must have an initial capital letter I . In iOS apps, this file resides in the top-level of the bundle directory. In macOS bundles, this file resides in the bundle's Contents directory.

Where do I put info plist?

All you have to do is click on the blue project icon -on top of the left- and go to the “Build Settings” tab, search “Info. plist” and choose “Info. plist File” section.

How do I add two GoogleService info plist in XCode?

In the Xcode project navigator, select the app target. Switch to the Build Phases tab at the top, then add a New Run Script Phase. Name the phase “Setup Firebase Environment GoogleService-Info. plist”, or something to that effect, and place it before the “Copy Bundle Resources” step.

What is plist XCode?

The plist is a special file that configures your mobile app, telling it how to run. Every iOS app uses an Info.


2 Answers

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.
like image 193
Serendipity Avatar answered Sep 23 '22 23:09

Serendipity


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.

like image 22
Andrew Avatar answered Sep 23 '22 23:09

Andrew