How to use real android device for flutter development
I recently started learning Flutter. My 10 year old MBP with 8GB RAM is apparently not “enough” based on this documentation
It “recommends” 32GB RAM.
Lowest number listed is 8GB, but it means I can’t use Android Emulator, which seems like most common way to test the app during the development phase.
But I do have a real android device, can I use that instead ?
But most documentation talks/assumes emulator.
This does have information about using physical device, but I think it glosses over the instructions at a very high level.
Also, even after you click the above link, you have to explicitly click on
Physical Device
tab (Default being Android Emulator
)
As document says - for Windows, install the drivers, but I’m on Linux, so no
drivers required, but I needed adb
I installed sudo apt-get install android-tools-adb android-tools-fastboot
Followed by adb devices
(after enabling Developer Options
on the device,
which also isn’t trivial) after connecting the device to my laptop.
OK, so my machine recognized the Android device.
Now, I had to restart VSCode, so that Physical Device appears in the target platform.
I was finally able to run the namer app from the tutorial on the android device 🎉
My overall impression is that setting up laptop for Flutter development involves a LOT of components, luckily the documentation is mostly up to date, even if spread over various sites (e.g. Setting up Android Studio is a separate document, because Android is only one of the targets for Flutter)