0

I'd like to switch app names (bundle display name) via build config. So that way if I build by "dev" scheme I get an app on my home screen that is called "App Dev" and when I build my "stage" scheme I get an app called "App Stage" and so on.

So up until now this worked really good. I have a custom build setting entry in my project called APP_DISPLAY_NAME and I use that variable in my Info.plist to set the CFBundleDisplayName with $(APP_DISPLAY_NAME).

Now the app should be renamed to "My App". Two words, separated by space and for some reason Xcode drops the spaces. The app now get's called "MyApp", even though the value in the build settings contains a space.

I have tried adding  ,  , \U00A0 and funnily enough all these characters end up in the app name. I end up with "My App"... apparently the only character that doesn't work is space.

So how do I get my space back? Ideally without switching out the whole Info.plist for each build config.

JanMensch
  • 1,720
  • 1
  • 18
  • 27
  • read the updated section of this https://stackoverflow.com/a/46399849/4042468 – kerry May 15 '19 at 08:33
  • Hey Kerry, sadly this didn't answer the question. Just as the update in the reply states: "works only when typed in *.plist. Can't be inserted in Display name in Xcode project settings;", which is exactly what I need to do. – JanMensch May 15 '19 at 09:11

1 Answers1

0

OK, very strange but the answer is simple. The app name was simply just a tiny bit too long so iOS just decided to throw away the spaces...

So on iPhone SE and 6/7/8 the name just got changed from "My Appname Dev" to "MyAppNam...". On the XR for example it just works as it should.

Strange that Apple just drops the spaces.

JanMensch
  • 1,720
  • 1
  • 18
  • 27