skip to Main Content

I have a Flutter app that I usually run in VSCode using the Flutter run command. The app has 3 different flavors and a different entry point for each flavor. Here is how I run the app on VSCode:

flutter run --target lib/main_production.dart --flavor production

I would like to know how to run this app on Android Studio while changing the entry point (target) to something other than lib/main.dart. I am using Android Studio Giraffe | 2022.3.1 Patch 2

2

Answers


  1. With Flutter and Android Studio, here is how I run run my app using flavors and a specific entry point:

    flutter run --flavor production -t ./lib/main_production.dart
    
    Login or Signup to reply.
  2. You can follow the below steps in Android Studio

    Step 1: select edit configuration in the toolbar
    enter image description here

    Step 2: Update the name of the entry point and flavor as per your use cases

    enter image description here


    Same Configuration you can do in VS Code as well

    Follow this article for configuring launch.json as per the environment

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search