Expland Build Settings in Info.plist File Does Not Work for Command Line Tool Targets
| Originator: | mrjohnniewalker | ||
| Number: | rdar://21961400 | Date Originated: | 23-Jul-2015 04:03 PM |
| Status: | Closed | Resolved: | 27-Jul-2015 10:25 PM |
| Product: | Developer Tools | Product Version: | 6.4 |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
Replacing variables with those defined in build settings in a target’s info.plist is supported for most targets, but doesn’t work for command line targets which have an optional info.plist
Steps to Reproduce:
1. Open Xcode
2. Create a new project using the “OS X > Application > Command Line Tool” template
3. Verify that INFOPLIST_EXPAND_BUILD_SETTINGS (Expland Build Settings in Info.plist File) resolves to Yes
4. Add an info.plist to your project with commonly substituted variables, such as ${PRODUCT_NAME} for CFBundleDisplayName
5. Add the linker flags to include your info.plist in the built product: “-sectcreate __TEXT __info_plist Info.plist”
6. Build the target
7. Using the command line, verify the final info.plist: “otool -X -s __TEXT __info_plist -v /path/to/tool"
Expected Results:
The info.plist content in step 7 would have the variables replaced
Actual Results:
The info.plist content in step 7 still contains the variable placeholders (${PRODUCT_NAME})
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Response from DTS
This issue behaves as intended based on the following:
If you're using Linker flags for this, Xcode doesn't know about your info plist and can't process it. Please use the INFOPLIST_FILE and CREATE_INFOPLIST_SECTION_IN_BINARY build settings instead.