Closed dmitryn closed 1 year ago
Hey, thanks for rising that. We have a PR open that touches similar issues: https://github.com/react-native-community/cli/pull/1055 Would you like to have a look at see how we can get it merged? :)
@thymikee thanks for linking the #1055, it looks like it would solve the issue. Not sure how can i help with getting it merged though.
You could check out the branch locally, rebase to the latest master, and test if building and running android works will all different variants and flavors. You could then report feedback to the original PR so we could improve it. This would be great!
@dmitryn: thanks for you script
i have changed the installTask
to assemble
instead of install
. This is more a build task then a install task and consumes less time.
@thymikee: why is the pr #1055 not merged already?
@driiftkiing it's not rebased, also missing a more thorough review and testing. Help appreciated :)
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
Ask your Question
Hello,
I didn't open a bug for this as this is more like a question i think.
Running
run-android --deviceId=a28385e5
results in./gradlew build -x lint
which is not the command i expect to be running when i have multiple flavors.For instance, let's assume app has flavors: "dev" and "prod". Then i expect
./gradlew installDevDebug
command to be running, but not./gradlew build -x lint
which builds app for every flavor (including "prod" which we don't need).Here is the custom patch i'm using:
The command i'm using with this patch is
run-android --deviceId=a28385e5 --flavor=dev
which results in this gradle command:./gradlew app:installDevDebug
I also renamed
variant
toflavor
and addedtype
argument when you want different build type (not "debug" which is default). I think of "variant" more like combination of build flavor and build type so having them separate makes more sense imo https://developer.android.com/studio/build/build-variants?authuser=1Feel free to use it or modify for your needs.