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?
Asked
Active
Viewed 5,290 times
2 Answers
3
Run
Flutter doctor -v
to check for any issues (You may have to accept android-licences withflutter doctor --android-licenses
).Connect your android device (Debugging mode should be enabled in the developer options) with USB
You can see connected device in VSCode at bottom-right corner,select your device
Press F5 to run or use "
Flutter run
" command

Marco
- 89
- 1
- 3
-
Thanks but already did all that. – drazraut Jan 06 '22 at 15:21
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
-
1It 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
-
-
-
1Check 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