How to rename platform application name from "App" to something else?
When adding platform to ionic capacitor project by npx cap add ios
it generates ios/App
folder but I would like to name it ios/my-app
.
And if it is possible I would like to add two apps for the same project for different environments (ios/my-app-test
and ios/my-app-prod
).
The Ionic framework application name can be changed in the config. xml file, Go to your applications config. xml file and change the name in the tag that is responsible for your app name.
This is actually now addressed in the documentation here: https://capacitor.ionicframework.com/docs/ios/configuration/#renaming-the-application-s-default-app-name
You can't rename the App folder, but you can set the name of your app by renaming the "target" called "App".
target 'App' do # <- change 'App' to 'Your App Name'
capacitor_pods
# Add your Pods here
end
Don't try and change the name of the project itself or things can start to break... Just leave as App. The strategy by @bittor poza caused similar issues so make sure to only change the Target name.
From looking into this it seems the answer is no to both of your questions.
The IOS template comes from here:
https://github.com/ionic-team/capacitor/tree/master/ios-template
Which has the /App/ folder set without any configuration options.
The command starts here:
https://github.com/ionic-team/capacitor/blob/master/cli/src/tasks/add.ts
Then hands off to this file for ios:
https://github.com/ionic-team/capacitor/blob/master/cli/src/ios/add.ts
And all of the settings are put together here:
https://github.com/ionic-team/capacitor/blob/master/cli/src/config.ts#L182
Which shows that it just pulls in the template dir, with no option to configure any renaming of the subfolders within it:
https://github.com/ionic-team/capacitor/blob/master/cli/src/ios/add.ts#L17
I have changed the name of the project in two simple steps.
Official Xcode documentation
Edit: The proper way to avoid future problems when updating Capacitor is to follow the official documentation. Renaming the application's default App name
Example: Example
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