How To Set Up Android Development Tools On Linux
Increasingly, Android app development on Linux is growing. The main reason behind this is that the Linux platform makes it super easy to get a full developer workstation going (compared to other platforms.) Development is one of Linux’s strong suits, so naturally, setting up Android development tools on Linux is easy.
SPOILER ALERT: Scroll down and watch the video tutorial at the end of this article.
Android Development Tools On Linux
Android Studio is Google’s complete development suite for creating software on the Android platform. It comes with dozens of tools, emulation setup, and code to work with.
Note: Before attempting to install this software, please install Java. Failing to install Java will make Android Studio unusable.
Install Java
Getting Java for Linux differs, depending on the operating system you’re using. Generally, most Linux distributions have excellent support for OpenJDK. It’s an open implementation of the Java tools. It’s best to go this route, and most developers won’t notice the difference. Follow the instructions below to get Java working on your distribution.
Note: aside from OpenJDK, you may need to install other dependencies to run Android Studio on your Linux PC. For more information, check out the official guide page for Linux.
Ubuntu
Ubuntu users have easy access to OpenJDK. As of Ubuntu version 18.04, OpenJDK 11 is available. To install it, open up a terminal and use the Apt package management tool to get it going.
sudo apt install openjdk-11-jdk
Need more than just the standard OpenJDK 11 package? Check out these other packages.
Debian
Debian is a Linux distribution that focuses primarily on solid, stable software. It is because of this, the absolute latest version of OpenJDK is hard to get ahold of (version 11). Still, it is possible to get version 8, which is functional.
Note: if you absolutely have to have version 11, consider upgrading Debian from “Stable” to “Testing,” or at the very least using backports.
sudo apt-get install openjdk-8-jdk
Alternatively, install all Java JDK 10 stuff into Debian with:
sudo apt-get install openjdk-8-*
Arch Linux
Arch Linux is bleeding edge Linux, so there’s no issue getting a fairly current version of OpenJDK working correctly. Unfortunately, despite how recent Arch is, there’s currently no builds of version 11. Still, users have access to OpenJDK 10, which is fairly new.
To install the software, open up a terminal and use the Pacman packaging tool to get it running.
sudo pacman -S jdk10-openjdk
Fedora
Fedora Linux has version 10 of OpenJDK, which should be enough to run and develop on Android Studio. To install it, use the DNF package management tool in the terminal.
sudo dnf install java-openjdk -y
OpenSUSE
Depending on what version of OpenSUSE you use, your packages are either very new or very old. For this reason, getting one version of OpenJDK working across all versions of SUSE is a bit tricky.
To get OpenJDK working, head over to the download page for OpenSUSE. On the download page, select the version of OpenJDK you’d like, then click the “install” button to start the installation process.
Generic Linux
Many Linux distributions (even the obscure ones) use OpenJDK because it’s safe to include in software repositories. As a result, installing OpenJDK is incredibly easy. To get it working open up a terminal and search your package manager for “OpenJDK”. Alternatively, download it from the official website.
Download Android Studio
Unfortunately, Android Studio doesn’t have a downloadable binary package. Instead, users looking to use the development suite on Linux will need to download a compressed archive file.
Head over to the official download page and click on the Linux download link. Read through the EULA and check the box to accept the agreement to start the download. When the download finishes, open up a terminal window and use the Unzip tool extract Android Studio.
cd ~/Downloads unzip android-studio-ide-*-linux.zip
Using the CD command, move the terminal into the bin subfolder.
cd android-studio/bin
Install Android Studio
Start the Android Studio installation tool with:
./studio.sh
In the Android Studio Wizard, select the “Standard” option. When the Android Studio Wizard finishes the installation process, click the “Start a new Android Studio” option to begin development.
Android Command-line Tools
Aside from Android Studio, there are other important development tools for Linux that you may want to install. Specifically, command-line tools that allow users to interact with devices on Linux. Thankfully, installing these command-line tools isn’t as tedious as Android Studio.
To get the Android command-line tools working on Linux, follow the instructions below that match your Linux OS.
Ubuntu
sudo apt install android-tools
Debian
sudo apt-get install android-tools
Arch Linux
sudo pacman -S android-tools
Fedora
sudo dnf install android-tools -y
OpenSUSE
sudo zypper install android-tools
Generic Linux
Need the Android command-line tools but can’t find them in your Linux distribution’s software repository? Google has a standalone download for those that need it. Head over to the official download page, and scroll down to “command line” to get it.