Step by Step guide to installing Android Studio on Linux

Step By Step Guide To Installing Android Studio On Linux

Android Studio is the official Google IDE used for android development. It is packed with features such as emulation support, Firebase integration, live changes, drag-and-drop app layout editors, and much more. This has led it to be a staple in the app development field.

Features of Android Studio

  1. Intuitive UI Design: Android Studio has a user-friendly interface that makes it easy for Linux users to develop Android apps.
  2. Code Editor: It has a powerful code editor with code completion, error highlighting, and refactoring support.
  3. Debugging and Profiling Tools: Android Studio provides advanced debugging and profiling tools to help Linux users identify and resolve issues in their apps.
  4. Gradle-based Build System: It uses the Gradle build system, which makes it easier to manage dependencies and automate tasks.
  5. Emulator: Android Studio includes an emulator that allows Linux users to test their apps on various Android devices and configurations.
  6. Source Control Integration: It supports integration with popular source control systems like Git, which helps Linux users collaborate with their team.
  7. Support for Kotlin and Java: Android Studio supports both Kotlin and Java programming languages, giving Linux users the flexibility to choose the language that suits their needs.

In this article we will learn how to install and setup Android Studio on Linux, so you can get started with your app development journey.

Installation :

There are multiple ways of installing Android Studio on Linux. In the tutorial we will go through all of them.

Installing via Archive Tarball

Step 1 : Go to the Downloads page and download the tar.gz file.

Amdroid Studio Downloads Page

Step 2 : Extract the tarball using the tar command. For example, if the name of the archive tarball is android-studio-2022.1.1.19-linux.tar.gz the command should be :

tar -xvzf /path/to/tarball/android-studio-2022.1.1.19-linux.tar.gz
Extract Android Studio

Step 3: To start Android Studio, navigate to the extracted directory (it should be named android-studio), go to the bin, and execute ./studio.sh like, shown below.

Starting Android Studio

Step 4 (Optional but recommended): Navigating to the directory every time you want to work with Android Studio might be a hassle. Instead, you can link the Android Studio binary (the ./studio.sh file) in the local binaries directory (/usr/local/bin). To do that, execute the following command.

sudo ln -s /path/to/extracted/directory/bin/studio.sh /usr/local/bin/android-studio

Explanation : All the binaries that are in /usr/local/bin directory can be executed from anywhere in the system. For that reason, we are making a binary named android-studio in /usr/local/bin and adding a soft link to the original studio.sh file. Now you can just type android-studio in the terminal, and it will start Android Studio.

Adding Android Studio To Path

Just for housekeeping, it is also a better idea to keep the installation directory in a proper directory like /opt/ (which is reserved for the installation of add-on application software packages) rather than randomly keeping it in Downloads.

Installation via Snaps

Snaps are a great way to install the same package on multiple distributions without all the hassle of extracting and setting up the application. To download Android Studio using Snap, first make sure that snaps are installed on your distribution.

If you are having any difficulties with installing, setting up, or understanding Snap, please refer to Snaps in Linux: A Basic Introduction

Now that you are all ready, execute the following command to install and run Android Studio.

sudo snap install android-studio --classic
snap run android-studio 

Upgrading Android Studio

You can upgrade Android Studio using the software’s internal functionality. Go to Help > Check for Updates, and it will show you all the updates from the different channels (Beta, Stable, etc.)

Upgrading Android Studio

Conclusion

In this article, we discussed the two popular ways to install and then upgrade Android Studio. Android Studio is the most popular development IDE developed by Android itself and is a staple in the app development community. Happy developing!