简体   繁体   中英

Xcode scheme change display name

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

You can do that easily.

  1. Add a "User-Defined Setting" (eg 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)"

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM