✨ Change Flutter App Package Name Using change_app_package_name
Package
Changing your Flutter app's package name (also called application ID) might sound like a minor task — but it often turns into a confusing tangle of Android/iOS configuration files.
Luckily, there's a simple way to do it in seconds using a neat little package called change_app_package_name.
Let’s walk through the process!
đź§ Why Change the Package Name?
The package name uniquely identifies your app on the Play Store and App Store.
Examples:
-
com.mycompany.myapp
— Production app -
com.mycompany.myapp.dev
— Development build
You may want to change it when:
- You clone an app template
- You’re rebranding your app
- You maintain multiple flavors (dev/stage/prod)
🛠️ Traditional Way (Painful)
Traditionally, changing the app ID requires:
- Manually editing the Android
AndroidManifest.xml
,build.gradle
, andMainActivity.kt
- Updating iOS
Runner.xcodeproj
andInfo.plist
One mistake, and the build fails. That’s where this package saves the day.
🚀 Meet the change_app_package_name
Package
This package lets you change your Flutter project’s package name for Android, and IOS with a single command — and it automatically updates all the relevant files.
📦 Pub link: change_app_package_name
âś… Step-by-Step Guide
1. 📥 Install the Package
Add it as a dev dependency in your pubspec.yaml
:
dev_dependencies:
change_app_package_name: ^1.1.0
or run this command
flutter pub add -d change_app_package_name
2. Update dependencies
Do Ctrl + S to Save OR write command in terminal to update.
flutter pub get
3. ✨ Run the Change Command
Use the following command in terminal:
Run this command to change the package name for both platforms.
dart run change_app_package_name:main com.new.package.name
To rename only Android:
dart run change_app_package_name:main com.new.package.name --android
To rename only IOS:
dart run change_app_package_name:main com.new.package.name --ios
Where com.new.package.name
is the new package name that you want for your app. replace it with any name you want.
âś… This updates all necessary Android files (AndroidManifest.xml, MainActivity.kt, Gradle files).
4. đź§Ş Test the Change
Rebuild the app:
flutter clean
flutter run
Also check android/app/src/main/AndroidManifest.xml and android/app/build.gradle — they should now reflect the new package name.
âś… Conclusion
Changing your Flutter app's package name is essential when preparing for production or managing multiple builds.
With change_app_package_name
, it takes just one command — no risky file editing required.
Top comments (0)