In this tutorial, let’s learn how to set up Flutter with an Android emulator without a powerful device. Stay here and learn Flutter setup without Android Studio:
- Install and setup Flutter with Vs Code
- Install a lightweight emulator (LD Player) for Windows
- Connect the emulator with VS Code
- Run it 🙂
Flutter setup without Android Studio
Flutter is a powerful cross-platform framework that enables code reuse across websites, desktop, and mobile applications. It’s an excellent choice because it compiles directly for the target device, ensuring fast, stable, and high-performance apps
Install and setup Flutter with Vs Code
VS Code is a light and free code editor that will allow us to develop the flutter code. To download it, let’s navigate to the VS Code download page, which is at Download Visual Studio Code – Mac, Linux, Windows.
- We will follow the next guide Set up an editor | Flutter, step by step:
- Once you have VS Code, open it and navigate to the Extensions icon and install Flutter extension
- Open the command palette (with F1 or Ctrl+Shift+P or Shift+Cmd+P) and select Flutter: New Project and select where you will save the project, then name your project.
- Follow the setup in Your first Flutter app to get a demo code.
- Follow the guide to run the application with Your first Flutter app, and select the target device (web browser) to test, and run the app
After a few minutes, you will see the result in the browser
Install a lightweight emulator (LD Player)
We will install the LD Player emulator for Windows from the official site at https://es.ldplayer.net/
Follow the installation process and wait till it completes. Now, you have your emulator ready.
Open it, select settings, others, and open ADB Connection
Additionally, you can change the size in Screen settings.
Connect the emulator with VS Code
Let’s start with setting up Java for compiling mobile apps. As of now, we require at least Java 17:
- Download Java SE 17 from Java Platform, Standard Edition 17 Reference Implementations from Windows 11 x64 Java Development Kit
- Extract the files to any folder; it can be at C:\Java so you will have all the files at
C:\Java\jdk-17.0.0.1
- Edit the system variables and add JAVA_HOME with
C:\Java\jdk-17.0.0.1
and save all - Add
C:\Java\jdk-17.0.0.1\bin
to the path as a new entry - Open a cmd terminal and run
java --version
to verify it- openjdk 17.0.0.1 2024-07-02
- OpenJDK Runtime Environment (build 17.0.0.1+2-3)
- OpenJDK 64-Bit Server VM (build 17.0.0.1+2-3, mixed mode, sharing)
We will follow the next tutorial Detail Flutter Installation Without Android Studio just using cmdline-tools, git, cmd · GitHub
Download command-only tools for Android from Download Android Studio & App Tools – Android Developers, select your operative system
Extract the files in C:\Development\android_sdk\cmdline-tools\tools
Edit the system variables and add C:\Development\android_sdk\cmdline-tools
\tools\bin
to the path, open a terminal and run sdkmanage to verify the installation, and install the next (Type Y if needed):
sdkmanager --install "cmdline-tools;latest"
sdkmanager "platforms;android-29"
sdkmanager "platform-tools"
sdkmanager "build-tools;29.0.3"
sdkmanager --licenses
Add the next vars with edit system variables
- ANDROID_HOME -> D:\Development\android_sdk
- ANDROID_SDK_ROOT -> D:\Development\android_sdk
Add the next values to the Path
- %ANDROID_SDK_ROOT%\cmdline-tools\tools\bin
- %ANDROID_HOME%\emulator
- %ANDROID_HOME%\tools
- %ANDROID_HOME%\platform-tools
Now, let’s set up Flutter, Let’s follow the next steps:
- flutter doctor –verbose to see the paths
- Update Java Path with
flutter config --jdk-dir="C:\Java\jdk-17.0.0.1"
- Update Android SDK path with
flutter config --android-sdk "C:\Development\android_sdk"
- Restart VS Code
- Update Java Path with
- In VS Code run
flutter doctor -v
- Everything should be in green, except for setting up Visual Studio Code to run desktop applications
Run flutter doctor --android-licenses
- Run sdkmanager –install “cmdline-tools; latest” if you see the next error, Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.
Run it
Finally, let’s just open the LD Player and see if the device appears in VS Code; otherwise, open the adb from C:\Development\android_sdk\platform-tools:
- .\adb.exe devices, it should display the emulator
Try to close all unnecessary apps to reduce processor and memory exhaustation.
Select the emulator in devices and click Run, wait for some time:
We are all set up. Happy Coding 🙂 !