Xcode scheme change display name

僤鯓⒐⒋嵵緔 提交于 2020-05-14 14:50:08

问题


I have a custom Xcode build scheme that moves some files to toggle between dev and prod variables. Can I change the app display name in the dev scheme as well?

For example, if the app name is "MyApp", it currently shows up on the home screen as "MyApp". Can I configure my dev build scheme so that it shows up on the home screen as "MyApp Dev"? I tried setting TARGET_NAME="MyApp Dev" in a pre-action build script, but it doesn't seem to work.

Xcode 7, iOS 9


回答1:


You can do that easily.

  1. Add a "User-Defined Setting" (e.g. DISPLAY_NAME) to your target and set different values for different Schemes.
  2. Go to the "Info.plist" of your target and add "Bundle display name" key and set its value to "$(DISPLAY_NAME)"



回答2:


In Xcode 8 (at least), in your build settings you should already have a setting called "Product Name" (under "Packaging"). That will take different values for different schemes, although they all default to "$(TARGET_NAME)". That's why, if you don't specify the display name, it takes the target name.

You can change any or all of them.

This way, you don't have to create a new user-defined setting.




回答3:


This works for Xcode 9.

  1. Target (General tab)-> Display name - $(PRODUCT_NAME)

  2. In Build settings tab, search for Product Name and give the required product name under each schemes.



来源:https://stackoverflow.com/questions/33201489/xcode-scheme-change-display-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!