Pregunta

The Ionic framework is pretty great stuff. I was able to successfully build an app with some Angular code I have been working on, but I can't find an answer to the simple question of how to rename the app that gets generated. The output app is always called HelloCordova and there doesn't seem to be any documentation on how to change the name of the app. If I start manually digging through the project directory replacing HelloCordova, I end up with an app that won't run. Surely, people have solved this before.

¿Fue útil?

Solución

Edit: You want to change the config.xml file in your project's root directory. The tag which is responsible for the app name is <name>.

look up the config documentation for more.

Otros consejos

Updated

  1. Change the name in config.xml (@ project root) see the : documentation.
  2. Execute this command : $ sudo ionic cordova platform remove ios
  3. Check if the folder ios under platforms folder is deleted.
  4. Execute this command : $ sudo ionic cordova platform add ios

If changing the name is not working for any reason delete entire platform folder and then

cordova platform add ios
ionic build ios

If your looking to change the iconic view name be sure to also update ionic.project

Yes, you just have to modify the config.xml. Find a "name" tag and put your required name between this tag.

The following steps will help you as it did to me.

  1. Rename app name in config.xml <name>Your_new_name</name>

  2. ionic cordova plugin save

  3. ionic cordova rm ios
  4. ionic cordova add ios
  5. ionic cordova plugin add --save cordova-plugin-facebook4 --variable APP_ID="my_app_id" --variable APP_NAME="my_app_name" --variable CHANNEL_NAME="master"

In the parent directory of the ionic project there is a config.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.todo497320" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CHANGE NAME HERE</name>

Note that the project name will be seen in various other places in the app, all these will be changed automatically when the app is built

In the parent directory of the ionic project there is a config.xml

CHANGE NAME HERE

If changing the name is not working for any reason delete entire platform folder and then

cordova platform add ios ionic build ios

You should make this change in the config.xml found at the root of your project. For example you might have something like this:

***<widget id="com.ionicframework.exampleproject223738" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">***

Change the id to whatever you wish your package to be and it will work for the entire project, Android and iOS.

However, if you've already submitted to the app store with a package name, you cannot change the package name at this point. Not unless you want to submit a new project. Updates must be made with matching package names.

For ionic 4.5.0 the "ionic platform" command has been renamed and the following commands are not used anymore:

  • ionic platform remove ios
  • ionic platform add ios

Instead use:

  • ionic cordova platform add ios
  • ionic cordova platform remove ios

Note: ios or android depending on your case

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top