I made different branches from my master branch and changed minor things in each branch. now I want to be able to install all of them separately on my emulator and my actual device. I don't really know what distinguishes two flutter code bases, so I could change it in these branches. Now, my problem is that when I run this command, and install the apk, it re-installs the previous app, like the new apk is an update to the previous one. I don't want that. I want to be able to compare all of them in one device.
Asked
Active
Viewed 370 times
0
-
I think it is not possible, because you should change also the app id that on android is the package – vincenzopalazzo Jan 05 '22 at 08:39
-
There are [some things](https://stackoverflow.com/questions/51534616/how-to-change-package-name-in-flutter) you need to change in your android project of each branch to define it as a separate app. – trojanfoe Jan 05 '22 at 08:42
-
Does this answer your question? [How to change package name in flutter?](https://stackoverflow.com/questions/51534616/how-to-change-package-name-in-flutter) – trojanfoe Jan 05 '22 at 08:43
-
Does this answer your question? [How to create build variants in Flutter Android so that each build variants have different app id?](https://stackoverflow.com/questions/60666045/how-to-create-build-variants-in-flutter-android-so-that-each-build-variants-have) – Robert Jan 05 '22 at 14:22
1 Answers
0
you can only have one app with a unique package name like com.company.myappname .... installed on your device.
if you want to install 2 different versions of it, you have to set 2 different package names in each branch.
But keep in mind, by changing your package name... you have to recreate a keystore file for the new one ... or a new firebase push configuration ... and so on
I use dart-defines
to set the package name in build.gradle dynamically

Maurice Raguse
- 4,437
- 2
- 29
- 46