Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between "Info.plist" on my navigator panel and the "Custom iOS Target Properties"?

Hi i'm new to iOS development. There are many situations that we have to config our Info.plist. Most of the tutorial tell me to modify the Info.plist in my navigator panel. Just like this one (Info.plist).

However, modify this file doesn't work for me. Then i found another solution. Project -> Target -> Info, and you can find a "Custom iOS Target Properties". You can also set your property list here, and this work just fine for me.

So i'm wondering what's the difference between these two Info.plist? Since most of the tutorial point to the first one (which doesn't work for me), I think there must be something wrong. What should i do to make it work again? Thank you very much.

like image 418
胡思宇 Avatar asked Jan 30 '16 05:01

胡思宇


People also ask

What is iOS Info plist?

The Info. plist file contains critical information about the configuration of an iOS mobile app—such as iOS versions that are supported and device compatibility—which the operating system uses to interact with the app. This file is automatically created when the mobile app is compiled.

What is plist in iOS Swift?

What is a plist file? A plist or property list is an XML file containing data in form of key-value pairs. Just line a dictionary in the Swift, so it's a list of values associated with keys. In Xcode, you can open the plist's XML structure by right-clicking on a property list file, then choosing Open As → Source Code.

Where is the info plist file in Xcode 13?

The file is in the project but elsewhere, and in another format right now. To discover it click on the name of your project in the Navigator, then click your Target and, at last, click on the Info tab and you will get the Custom iOS Target Properties menu… the good old Info. plist!


2 Answers

They're same, the Info.plist is the resource, and the 2nd one just refer to it. If you tried to delete the Info.plist file from your project, you cannot see the "Custom iOS Target Properties" you mentioned anymore, it'll show sth like:

Information from info.plist not available. File may not exist at specific path.

I think you must did sth wrong in Info.plist that lead your setting won't work.


Btw, make sure the target's info.plist refer to the right one that you want. Cause generally, we'll have Dev, Beta, etc schemes for our project, and they own different plist files as well.

So make sure the INFOPLIST_FILE refer to the right one in settings: enter image description here

like image 180
Kjuly Avatar answered Sep 28 '22 02:09

Kjuly


Info.plist is equal to Custom iOS Target Properties[About]

  1. Make sure that Build Settings -> Info.plist File points to a necessary file(path location)
  2. Sometimes Xcode doesn't update Custom iOS Target Properties after changing Info.plist. You can restart Xcode as a variant
like image 39
yoAlex5 Avatar answered Sep 28 '22 03:09

yoAlex5