Home > database >  How to run flutter app on android mobile from VS Code on Linux?
How to run flutter app on android mobile from VS Code on Linux?

Time:01-06

I have configured flutter on my Linux Mint and I have downloaded the android command line tools instead of Android Studio. I have also updated the gradle and commandline-tools path on my Linux Mint. Now I want to install the app on my android smartphone and test. How can I do that?

CodePudding user response:

You can type this in your terminal in your project directory to get the release apk for your project

 flutter build apk --release

The release apk file will be in build>app>outputs>flutter-apk>app-release.apk

If you want to debug the app, then you can connect your android phone to your pc and then run this command in the terminal:

flutter run

and then select your android device from the options to debug your app

CodePudding user response:

  1. Run Flutter doctor -v to check for any issues (You may have to accept android-licences with flutter doctor --android-licenses).

  2. Connect your android device (Debugging mode should be enabled in the developer options) with USB

  3. You can see connected device in VSCode at bottom-right corner,select your device

  4. Press F5 to run or use "Flutter run" command

  •  Tags:  
  • Related