How to change the app id of a Ionic/Capacitor app?

Hi,
I have an Ionic5 app that uses Capacitor created with the standard procedure.
I can’t publish on the Android store because I have to rename the app id that is “io.ionic.starter”.

I have seen that there are 53 matches in 28 files of the “io.ionic.starter” string.
Is there a command or a standard procedure to change the app id?

thank you very much

cld

1 Like

It’s the appId property in capacitor.config.json. However you need to set it before generating the Android/iOS projects with npx capacitor add.

2 Likes

Hi, Mirko thank you.
But I’ve already launched the command.
So do I have to edit all the files?

There is not even the “capacitor rm” command.

cld

1 Like

If you don’t mind recreating the Android project, you can simply delete the folder with rm -rf android then recreate it with npx cap add android.

Otherwise you’ll have to manually edit the Android files. But I don’t think you need to change 28 files, probably just AndroidManifest.xml and app/build.gradle.

1 Like

I’ve renamed all the occurrences of io.ionic.starter, with my ide is fast enough, and it seems to work.
Probably the wizard that creates a new app should ask for the app id.

cld

1 Like

Hi, just follow these steps:

  1. run ionic capacitor rm
  2. change appid in capacitor.config.json
  3. run npx capacitor add
1 Like

thank you. this step must consider while creating project from scratch