Lädt...


🔧 Install Flutter SDK, Android SDK, and Start Android Emulator in WSL


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

In today’s rapidly evolving tech landscape, mobile app development has become a crucial skill for developers. Flutter, Google’s open-source UI software development toolkit, has gained immense popularity for its ability to create natively compiled applications for mobile, web, and desktop from a single codebase. This guide aims to walk you through the comprehensive process of setting up the Flutter SDK, installing the Android SDK using command line tools, and running an Android emulator on your system. Whether you are a beginner or an experienced developer, this step-by-step tutorial will help you get started with Flutter development in no time.

1. Verify Required Tools

Ensure the following tools are installed:
which bash file mkdir rm which
Expected output:

/bin/bash
/usr/bin/file
/bin/mkdir
/bin/rm
which: shell built-in command

2. Installed Required Packages

Update and install necessary packages:

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa

3. Install Flutter in VS Code

  1. Launch VS Code.
  2. Open the Command Palette: Control + Shift + P.
  3. Type flutter.
  4. Select Flutter: New Project.
  5. VS Code will prompt you to locate the Flutter SDK.
  • If you have the Flutter SDK installed, click Locate SDK.

  • If not, click Download SDK.

4. Download Command Line Tools

  1. Create necessary directories and download the tools:
mkdir -p ~/Android/Sdk/cmdline-tools
cd ~/Android/Sdk/cmdline-tools
wget https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip
unzip commandlinetools-linux-7302050_latest.zip
mv cmdline-tools latest

5. Set Up Environment Variables

  • Open your profile file (e.g., .bashrc or .zshrc):
    nano ~/.bashrc

  • Add the following lines:

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/emulator:$PATH
  • Apply the changes: source ~/.bashrc

6. Install Java

  • Install OpenJDK 17:
    sudo apt install openjdk-17-jdk

  • Determine the Java installation path:
    sudo update-alternatives --config java

  • Set JAVA_HOME and update PATH:
    nano ~/.bashrc

  • Add the following lines:

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
  • Apply the changes:
    source ~/.bashrc

  • Verify Java installation:
    java -version

7. Install Android SDK Packages

  1. Navigate to the command line tools directory: cd ~/Android/Sdk/cmdline-tools/latest/bin
  2. Install required SDK packages: ./sdkmanager --install "platform-tools" "platforms;android-30" "build-tools;30.0.3" "emulator" "system-images;android-30;google_apis;x86_64"
  3. Accept Licenses: ./sdkmanager --licenses

8. Create and Start an AVD

  1. Create and AVD:
    avdmanager create avd -n my_avd -k "system-images;android-30;google_apis;x86_64" --device "pixel"

  2. Start the emulator:
    cd ~/Android/Sdk/emulator
    ./emulator -avd my_avd

Troubleshooting

Error: libpulse.so.0 not found
sudo apt install libpulse0
KVM permission error
sudo chown username /dev/kvm

Running Android Emulator in VS Code

  1. Run Emulator from Command Line:
    cd ~/Android/Sdk/emulator
    ./emulator -avd my_avd

  2. Select Device in VS Code:

  • Open Command Palette: Ctrl + Shift + P
  • Select Flutter: Select Device
  • Choose your running emulator from the list

These steps should help you set up Flutter and the Android SDK, create and start an Android emulator, and integrate it with VS Code.

Setting up a Flutter development environment can seem daunting at first, but with the right tools and a systematic approach, it becomes a straightforward process. By following this guide, you have equipped yourself with the knowledge to install the Flutter SDK, configure the Android SDK, and run an Android emulator on WSL. This powerful setup will enable you to develop, test, and deploy high-quality mobile applications efficiently. As you continue your journey in mobile app development, remember that the community and resources available are vast and supportive. Happy coding!

Reference: Start building Flutter Android apps on Linux
(https://docs.flutter.dev/get-started/install/linux/android)

...

🔧 Install Flutter SDK, Android SDK, and Start Android Emulator in WSL


📈 69.53 Punkte
🔧 Programmierung

🎥 Flutter Performance, Flutter Games, Flutter Tooling, & More (#AskFlutter at Flutter Live)


📈 44.34 Punkte
🎥 Videos

🔧 Flutter news from GDD China: uniting Flutter on web and mobile, and introducing Flutter 1.9


📈 36.6 Punkte
🔧 Programmierung

🔧 What is WSL ? How to install WSL in Windows 11 ?


📈 34.11 Punkte
🔧 Programmierung

🎥 Origin of Flutter, Dart 2.0, E-Commerce with Flutter, & More (#AskFlutter at Flutter Live)


📈 33.25 Punkte
🎥 Videos

🪟 WSL Tips and Tricks to Speed up and improve WSL experience


📈 30.91 Punkte
🪟 Windows Tipps

🎥 Flutter 1.0, Square Reader SDK, 2Dimensions Flare, & More! (Flutter Live Top 5 Recap)


📈 30.31 Punkte
🎥 Videos

🎥 Flutter 1.0, Square Reader SDK, 2Dimensions Flare, & More! (Flutter Live Top 5 Recap)


📈 30.31 Punkte
🎥 Videos

🔧 Oficial! Gemini Google AI Dart/Flutter SDK— Integrando Flutter com o GEMINI


📈 30.31 Punkte
🔧 Programmierung

🐧 Plaso and WSL 2 - The WSL Adventures Continue... (X-Post)


📈 29.24 Punkte
🐧 Linux Tipps

📰 Microsoft Has No Plans to Abandon WSL 1, WSL 2 to Work on Windows 10 Home Too


📈 27.56 Punkte
📰 IT Security Nachrichten

🐧 x-Post to WSL: Experiencing WSL as a Linux Veteran - Part 1


📈 27.56 Punkte
🐧 Linux Tipps

🔧 Android Emulator Hypervisor Driver for AMD Processors - Canary SDK Package, Install Instructions


📈 27.28 Punkte
🔧 Programmierung

🎥 Hamilton app built with Flutter and featured on iOS and Android (Flutter Developer Story)


📈 27.2 Punkte
🎥 Videos

🎥 Hamilton app built with Flutter and featured on iOS and Android (Flutter Developer Story)


📈 27.2 Punkte
🎥 Videos

🕵️ Configuring a pretty and usable terminal emulator for WSL


📈 26.37 Punkte
🕵️ Hacking

🐧 WSL - Quick start (Install Ubuntu flavor as a linux subsystem on Windows 11)


📈 26.21 Punkte
🐧 Linux Tipps

🪟 Microsoft geht mit Emulator und SDK für Windows 10 an den Start


📈 24.94 Punkte
🪟 Windows Tipps

🎥 Q&A and Tour of Flutter Samples Index - The Boring Flutter Development Show, Ep. 7.4


📈 23.84 Punkte
🎥 Videos

🎥 Exploring Flutter Samples and Examples (The Boring Flutter Development Show, Ep. 11)


📈 23.84 Punkte
🎥 Videos

🎥 Flutter Live - Flutter Announcements and Updates (Livestream)


📈 23.84 Punkte
🎥 Videos

🔧 Flutter Hooks Tutorial: Flutter Animation Using Hooks (useEffect and useAnimationController)


📈 23.84 Punkte
🔧 Programmierung

🔧 Internationalizing and Localizing a Flutter App | How to Develop an App with Flutter – Part 7


📈 23.84 Punkte
🔧 Programmierung

🪟 Microsoft Emulator and Windows 10X Emulator Image (Preview) build 19578 available now!


📈 23.5 Punkte
🪟 Windows Tipps

🔧 Emulator 30.0.12 Canary, PSA: If emulator not starting on Windows, look for and uninstall Riot Vanguard


📈 23.5 Punkte
🔧 Programmierung

🔧 Emulator 30.0.12 Stable, PSA: If emulator not starting on Windows, look for and uninstall Riot Vanguard


📈 23.5 Punkte
🔧 Programmierung

📰 Android Wear SDK and Emulator Update


📈 22.41 Punkte
🤖 Android Tipps

📰 FLUTTER & DART – THE COMPLETE FLUTTER APP DEVELOPMENT COURSE


📈 22.17 Punkte
📰 Alle Kategorien

🎥 Adding a Streams API to a Flutter Plugin - The Boring Flutter Development Show, Ep. 7.5


📈 22.17 Punkte
🎥 Videos

🎥 How to Publish a Flutter Package - The Boring Flutter Development Show, Ep. 7.3


📈 22.17 Punkte
🎥 Videos

🎥 Alibaba used Flutter to build 50+ million user Xianyu app (Flutter Developer Story)


📈 22.17 Punkte
🎥 Videos

🎥 Publishing a Flutter App to the Play Store (The Boring Flutter Development Show, Ep. 8.4)


📈 22.17 Punkte
🎥 Videos

🎥 Flutter's Search Support - The Boring Flutter Development Show


📈 22.17 Punkte
🎥 Videos

🎥 Flutter Design (Flutter Live)


📈 22.17 Punkte
🎥 Videos

matomo