Flutter¶
Install on Windows¶
In order to have a working minimal developer environment (aka, without Android Studio installed), i have researched quite a bit on available resources, and with try and error approach i managed to get things working with following setup:
Download flutter;
Download the older sdk-tools to ‘D:\Develop\android\sdk’. Could not make it with Command Line Tools latest version (at the time of writing ‘commandlinetools-win-6200805_latest.zip’);
Download Adoptopenjdk 8 (LTS) version to ‘D:\Develop\adoptopenjdk-8’;
Create the following user environment variables:
Variable |
Value |
|---|---|
ANDROID_HOME |
D:\Develop\android |
ANDROID_SDK_ROOT |
D:\Develop\android\sdk |
FLUTTER_HOME |
D:\Develop\flutter |
JAVA_HOME |
D:\Develop\adoptopenjdk-8 |
Path |
%ANDROID_HOME% %FLUTTER_HOME%\bin %ANDROID_SDK_ROOT% %ANDROID_SDK_ROOT%\bin %JAVA_HOME%\bin |
Install VS Code and Flutter/Dart plugins;
Open a command prompt/powershell and check if android sdk tools work:
sdkmanager --list
Run flutter doctor to verify dependecy problems:
flutter doctor -v
Install Android SDK:
sdkmanager --install "build-tools;29.0.3" "emulator" "extras;intel;Hardware_Accelerated_Execution_Manager" "patcher;v4" "platform-tools" "platforms;android-29" "system-images;android-29;default;x86_64" "system-images;android-29;google_apis;x86_64"
Installing Standalone Intel HAXM on Windows:
Verify that Intel HAXM is running:
Open a Command Prompt window with administrator privileges (Run as Administrator) and execute the following command:
sc query intelhaxm
If Intel HAXM is working, the command will show a status message indicating that the state is: “4 RUNNING”.
To stop or start Intel HAXM, use these commands:
Stop:
sc stop intelhaxm
Start:
sc start intelhaxm
Create emulator¶
List available devices:
avdmanager list
Create avd/emulator:
avdmanager create avd --force --name Nexus6P --abi google_apis/x86_64 --package 'system-images;android-29;google_apis;x86_64' --device "Nexus 6P"
Lists existing Android Virtual Devices (avd):
avdmanager list avd
Run avd/emulator:
emulator @Nexus6P
Working workflow¶
Start emulator device in VS Code;
Start app:
flutter app