1

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?

drazraut
  • 41
  • 2
  • 5

2 Answers2

3
  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

Marco
  • 89
  • 1
  • 3
1

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

Rohith Nambiar
  • 2,957
  • 4
  • 17
  • 37
  • 1
    It generated error with something like `Could not open settings generic class cache for settings file ....` – drazraut Jan 06 '22 at 15:18
  • ` FAILURE: Build failed with an exception. * What went wrong: Could not open settings generic class cache for settings file '/home/dhiraj/Documents/FlutterProjects/firstapp/android/settings.gradle' (/home/dhiraj/gradle/bin/caches/7.0.2/scripts/bt53u1oym6apy0m101vnrgrbi). > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61 * Try: Run with --stacktrace option to get the stack trace. BUILD FAILED in 1s Running Gradle task 'assembleRelease'... 2,954ms Gradle task assembleRelease failed with exit code 1 ` – drazraut Jan 06 '22 at 15:20
  • What java version are you using? – Rohith Nambiar Jan 06 '22 at 15:26
  • java 17.0.1 2021-10-19 LTS – drazraut Jan 07 '22 at 07:09
  • 1
    Check this link: https://stackoverflow.com/questions/67240279/could-not-open-settings-generic-class-cache-for-settings-file – Rohith Nambiar Jan 07 '22 at 09:42