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

2

8

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.

Psycholinguistics answered 30/1, 2016 at 5:46 Comment(0)
M
8

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

Mackler answered 30/1, 2016 at 5:57 Comment(5)
Thank you for the clarification! But how can i make sure i'm referring to the correct file? I've checked Build Settings -> Packaging -> info.plist FILE. The path showed (MyProjectName)/Info.plist, seems correct to me?Nydia
@Psycholinguistics yup, it refers to the right one. so i think u might did sth wrong in info.plist while editing the resource. btw, what setting do u want to modify? And generally, if u can achieve what u want by editing "Custom iOS Target Properties", just do it there, editing pure plist resource file might lead the file unreadable if u did sth wrong.Mackler
I'm connecting my app to the server, and i got the messeage "App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file." . I've searched for answers online, and added "App Transport Security Settings" -> "Allow Arbitrary Loads"-> "YES" in my Info.plist. But nothing changed. Then i did the same thing again in my Custom iOS Target Properties, and everything turned out to be fine. So that drive me here to ask the question lol.Nydia
@Psycholinguistics weird, editing plist file to modify "App Transport Security Settings" is totally fine, once u done editing it, the setting in "Custom iOS Target Properties" should be updated as well.Mackler
Hey i just recreated an Info.plist with exactly the same content. I tried editing it again, and the "Custom iOS target Properties" did updated finally! Though still don't know what's the problem is, but thank you very much !!Nydia
M
3

Info.plist vs Custom iOS Target Properties

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

enter image description here

  1. Make sure that Build Settings -> Info.plist File(INFOPLIST_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
Mulder answered 9/10, 2020 at 16:26 Comment(2)
They are indeed the same, which you can prove by changing a setting in one place and seeing it in the other, but why does info.plist hide some items that appear in Custom iOS Target Properties?Deina
Disregard, I found the answer with experimentation: The Custom iOS Target Properties show a hybrid of some items from info.plist, and some items that are stored in the project.pbxproj file. You can't tell just by looking at them--when you change a setting in Custom iOS Target Properties, it could be changing an item in either of the 2 places.Deina

© 2022 - 2024 — McMap. All rights reserved.