capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

[QUESTION] CAP Init

Open BKHines opened this issue 8 years ago • 2 comments

What exactly does this command do: "npx cap init [appName] [appId]"? The reason I ask is because I have built an app where the app id and name are not determined until I create a build.

My config.xml looks like this:

App Name Comes From Configuration ...

Since I'm using Visual Studio 2017 at the moment, I get the app name and id via a configuration name. Then I run a gulp task that takes the configuration name and fills in the appropriate pieces of the config. "com.eventhyped.appidcomesfromconfiguration" becomes "com.eventhyped.cincychristmas". Would the cap init command still work if I initialized "com.eventhyped.appidcomesfromconfiguration" and then changed it when I was building for the stores? Is that command simply to initialize for development purposes or does that initialize it for the app to use capacitor?

BKHines avatar Mar 28 '18 11:03 BKHines

This command creates the capacitor.config.json file with the values you provide, which Capacitor then uses when creating new app projects. It does not stay in sync, so if you create the app project and want to change/customize an ID, you have full control over that

mlynch avatar Mar 28 '18 11:03 mlynch

Perfect. Thanks so much for the quick reply. I appreciate it.

BKHines avatar Mar 28 '18 11:03 BKHines