Simple steps to rename your app
Well, when you start developing an app, you might not think about choosing the proper name (or is it just my issue?). Anyway, perhaps some of you will find this article useful.
Imagine we have iOS and Android apps developed with Flutter, and we've named our app 'Example.' Such a nice name, right? Just before the release, you come up with a mind-blowing app name, which I believe is one of the keys to success for your application. So, let's start cleaning up our mess. There are two ways to do this. First, I'll explain the longer method. Which is rename everything manually
Flutter project
Here everything starts with your pubspec.yaml file
Okay here we have to rename name tag to your nice app name. After you rename - most likely you'll have a compile error, because all internal imports in your project will become invalid:
This one you can fix manually.
Next step would be to change launch.json file for bigger convenience, so you can see you build variants correctly.
Android project
In Android project you have to add changes in these files
Additionally you need change the folders names inside main folder + package name in MainActivity class
Inside build.gradle file you need to change namespace and applicationId
领英推荐
In AndroidManifest.xml you would need to change label parameter.
And I believe this is it for Android. Now it's ios turn
iOS project
In ios everything is simple and straightforward as well. You have to open your iOS project using XCode. In case if you've never done this before, just open your Runner.xcworkspace (not xcodeproj) which is located in iOS folder.
In "General" tab you have to update identity, with your appname and bundle identifier.
And of course you would need to change Signing and Capabilities in the similar way.
Important that I have to create Bundle Identifier on your Appstore connect, to be able to release on Testflight and Appstore.
And finally inside file Info.plist which is located here ios/Runner/Info.plist you would also need to update CFBundleDispayName and CFBundleName. This step you can complete in your VSCode/Android Studio/Intelij Idea.
And this is it :) As a conclusion I would like to provide you a check list for your actions.
In VSCode/Android Studio/Intelij Idea I need:
In XCode:
There is also another way. In XCode you can use Cmd + Shift + H (Find and Replace) and replace your test appname with real appname. This approach can bring some compile errors and I believe it's not a time saver. But you have to decide.
Happy coding! :)