Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change a Cordova/iOS app's "displayed name" without changing the entire file structure/Xcode project?

Tags:

xcode

ios

cordova

So, I working on my first Cordova app, and I've got a probably typical noob question...

I created my app with this command:

cordova create MyFirstApp com.[my_domain].myfirstapp MyFirstApp

I can see that this creates a complex file structure under a directory named MyFirstApp, an Xcode project named MyFirstApp.xcodeproj, and dozens of files beginning with MyFirstApp (e.g., MyFirstApp-Info.plist, MyFirstApp-Prefix.pch, etc).

All of that is fine.

But, after finishing development - I realize that I'd like the app's name as it appears on the user's homescreen to be something different (E.g., "Cool App!").

Can I change just the "displayed name" without making a mess of the directory structure and Xcode project?

It looks like the name node in config.xml doesn't do this - that value seems to control much more than just the way the name is displayed. (E.g., if I change it, cordova build iOS fails and Xcode starts complaining...)

like image 382
mattstuehler Avatar asked Feb 06 '15 19:02

mattstuehler


3 Answers

You can change CFBundleDisplayName in your *-Info.plist file by adding the following to Cordova's config.xml

<config-file parent="CFBundleDisplayName" platform="ios" target="*-Info.plist">
    <string>My App</string>
</config-file>
like image 69
Sean Lynch Avatar answered Nov 08 '22 08:11

Sean Lynch


You can add a short name to the name element in the config.xml of your app:

<widget ...>
   <name short="HiCdv">HelloCordova</name>
</widget>

Reference


Or if the above doesn't work, you can try this instead:

<platform name="ios">    
    <edit-config file="*-Info.plist" mode="merge" target="CFBundleDisplayName">
            <string>Your Display Name</string>
    </edit-config>
    ...
</platform>

Place that code in the config.xml file for the name to persist between builds meaning you don't need to manually edit every time.

like image 34
Simon L. Brazell Avatar answered Nov 08 '22 08:11

Simon L. Brazell


Edit Bundle display name node in MyFirstApp-Info.plist.

like image 25
Marcus Adams Avatar answered Nov 08 '22 07:11

Marcus Adams