Capacitor: Different bundle-ids for android and iOS

Created on 15 Mar 2018  路  4Comments  路  Source: ionic-team/capacitor

This is more of a question:
Whats the way to go when having different bundle-ids for android and iOS? Add capacitor with one bundle-id and then change it manually in either XCode or Android Studio?
Will the CLI ever overwrite this config? Because if thats the case there should probably be appIdAndroid and appIdIos in capacitor.config.json.

Most helpful comment

Hi, is this possible to consider this requirement again please? Thanks!

All 4 comments

Yep just change it manually in Xcode/Android Studio. We won't modify it after the project is created.

Will keep an eye out for this question and possibly add it to the docs.

Hi, is this possible to consider this requirement again please? Thanks!

same for us each sync override it just allow us to have a specific one by platform section it's painfull

To deal with this issue I created a bash script that replaces android/app/src/main/assets/capacitor.config.json with a file that has the correct bundle id. And then I created an npm command that runs that shell script after running ionic sync.

so the shell script looks like this:

rm android/app/src/main/assets/capacitor.config.json
cp build/resources/capacitor.config.json android/app/src/main/assets/capacitor.config.json

and the npm command looks like this.

"scripts": {
  ...
  "sync": "ionic cap sync && ./scripts/post-sync.sh"
  ...
}

and then I can just run

npm run sync

instead of the normal ionic command

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peterpeterparker picture peterpeterparker  路  3Comments

TayKara picture TayKara  路  3Comments

danielsogl picture danielsogl  路  3Comments

natevw picture natevw  路  3Comments

nicobytes picture nicobytes  路  3Comments