Cover image banner for installing Flutter without Android Studio

Setting up Flutter on Linux is pretty much straightforward. The official documentation is well detailed and numerous tutorials on the web explain how to configure a Flutter development environment on Linux. However, installing Android Studio is a major requirement as Flutter depends on several packages and libraries that ship with Android Studio.

A lot of people (myself included) prefer to use another editor such as Visual Studio Code instead of Android Studio to develop Flutter applications for various reasons, one of which is that VS Code is more lightweight than Android Studio. The main concern that follows is the “wasted” disk space due to Android Studio’s installation.

Being a minimalist, I decided to tinker around and after a few days of trial and error, I managed to get Flutter to work without installing or depending on Android Studio by writing some Bash scripts that automate the whole process.

Solution

Step 1: Install OpenJDK

Create a file install-jdk.sh with the following contents:

#!/bin/bash

## File: install-jdk.sh
## Copyright © 2022, 2026 Muzaffar Rayyan Auhammud
## License: MIT License (https://mit-license.org/)

set -eu

JDK_VERSION="25.0.2"
INSTALL_DIR="/opt/openjdk"
JAVA_HOME="$INSTALL_DIR/jdk-$JDK_VERSION"

ENV_FILE="$HOME/.profile"
case "${SHELL##*/}" in
    bash)
        ENV_FILE="$HOME/.bashrc"
        ;;
    zsh)
        ENV_FILE="$HOME/.zshrc"
        ;;
    *)
        ENV_FILE="$HOME/.profile"
        ;;
esac

if [ -f "$JAVA_HOME/bin/javac" ]; then
    echo "Info: OpenJDK $JDK_VERSION already exists at '$JAVA_HOME'"
    exit 0
fi

cd ~/Downloads
wget -c https://download.java.net/java/GA/jdk$JDK_VERSION/b1e0dfa218384cb9959bdcb897162d4e/10/GPL/openjdk-${JDK_VERSION}_linux-x64_bin.tar.gz
sudo mkdir -p $INSTALL_DIR
sudo tar xzf openjdk-${JDK_VERSION}_linux-x64_bin.tar.gz -C $INSTALL_DIR

echo -e "\n#### OpenJDK $JDK_VERSION ####" >> $ENV_FILE
echo "export JAVA_HOME=\"$JAVA_HOME\"" >> $ENV_FILE
echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> $ENV_FILE

source $ENV_FILE

Open a Terminal window and run the script as follows:

bash install-jdk.sh

Step 2: Install Android SDK

Create a file install-android-sdk.sh with the following contents:

#!/bin/bash

## File: install-android-sdk.sh
## Copyright © 2022, 2026 Muzaffar Rayyan Auhammud
## License: MIT License (https://mit-license.org/)

set -eu

ENV_FILE="$HOME/.profile"
case "${SHELL##*/}" in
    bash)
        ENV_FILE="$HOME/.bashrc"
        ;;
    zsh)
        ENV_FILE="$HOME/.zshrc"
        ;;
    *)
        ENV_FILE="$HOME/.profile"
        ;;
esac

ANDROID_HOME="$HOME/Android/Sdk"

cd ~/Downloads
wget -c https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
mkdir -p $ANDROID_HOME/cmdline-tools
unzip commandlinetools-linux-8512546_latest.zip -d $ANDROID_HOME/cmdline-tools
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest

cd ~/Downloads
wget -c https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip -d $ANDROID_HOME

echo -e "\n#### Android SDK ####" >> $ENV_FILE
echo "export ANDROID_HOME=$ANDROID_HOME" >> $ENV_FILE
echo "export PATH=\$ANDROID_HOME/platform-tools:\$PATH" >> $ENV_FILE
echo "export PATH=\$ANDROID_HOME/cmdline-tools/latest/bin:\$PATH" >> $ENV_FILE
echo "export PATH=\$ANDROID_HOME/emulator:\$PATH" >> $ENV_FILE
source $ENV_FILE

# Android 16 (API 36) Platform API and build tools
sdkmanager --install "platforms;android-36" "build-tools;36.1.0"

Just like before, open a Terminal window and run the installation script as follows:

bash install-android-sdk.sh

Step 3: Install Flutter SDK

Create a file install-flutter-sdk.sh with the following contents:

#!/bin/bash

## File: install-flutter-sdk.sh
## Copyright © 2022, 2026 Muzaffar Rayyan Auhammud
## License: MIT License (https://mit-license.org/)

set -eu

ANDROID_HOME="$HOME/Android/Sdk"

if ! command -v "snap" >/dev/null 2>&1; then
    echo "Error: snap command is not available."
    echo "Please install snap first: https://snapcraft.io/docs/tutorials/install-the-daemon/manjaro-linux/"
    exit 1
fi

sudo snap install flutter --classic
flutter upgrade
flutter config --android-sdk $ANDROID_HOME
flutter config --enable-web
flutter doctor --android-licenses
flutter doctor
flutter config --no-analytics
dart --disable-analytics

Similar to the above steps, open a Terminal window and run the installation script as follows:

bash install-flutter-sdk.sh

Accept all the licenses when prompted, and you should have a complete Flutter development environment without requiring Android Studio to be installed.

Note

If you're unable to launch and debug Flutter apps on your smartphone through USB emulation, first check if ADB is enabled on your phone and the latter is properly connected to your computer.

Then, run the following command in a Terminal window and grant your phone permission to access the computer through ADB when prompted:

adb kill-server && \
adb start-server && \
adb devices