Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - How to make it use different plist file for same code base, different targets

I have a code base that I need to build out to two different targets. The only difference is they read different config.plists, config-1.plist for target #1 and config-2.plist for target #2. What do I need to do in the building to achieve this?

like image 353
Boon Avatar asked Apr 15 '11 21:04

Boon


People also ask

How do I change the target file in Xcode?

In the Project tool window, right-click the file and select Manage Targets. In the Manage Targets dialog, choose the required targets from the list and click OK.

How do I change the info plist path in Xcode?

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

How do I add two GoogleService info plist in Xcode?

Open Xcode, then right-click on Runner directory and select Add Files to "Runner" . Select GoogleService-Info. plist from the file manager. A dialog will show up and ask you to select the targets, select the Runner target.


1 Answers

Like this:

  • Select your project from the navigator to the left
  • Select the target you want to change (under TARGETS)
  • Click "Build Settings"
  • Search for "Info.plist"

In the Packaging section, you should see a setting called Info.plist file.

  • Change that to you "config-2.plist" or whatever you want.

You also need to create the two plist-files of course.

like image 185
Martin Wickman Avatar answered Nov 25 '22 14:11

Martin Wickman