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...)
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>
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.
Edit Bundle display name
node in MyFirstApp-Info.plist
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With