Installing Android Studio On Ubuntu 22.04: Complete Guide
Tags: android, jetbrains, ubuntu, installations
Published: 2023-04-04 13:08:42

*Are you new to Android Development?* And do you want to learn how to setup your **Integrated Development Environment (IDE)** for building your projects? Then you are in the right place!

Android Studio is the **official IDE** for developing Android apps. It comes with powerful features that help you build your applications faster and easier.

For Linux users, this guide will take you through the nitty gritty of getting your IDE setup. **Let's get started!**

##System Requirements

Since we are setting up on Linux, here are the system requirements as listed on the [Official download page](https://developer.android.com/studio#downloads) for Android Studio:

1. x86_64 CPU architecture; 2nd generation Intel Core or newer, or AMD processor with support for AMD Virtualization (AMD-V) and SSSE3.

2. Any 64-bit Linux distribution that supports Gnome, KDE, or Unity DE; GNU C Library (glibc) 2.31 or later.

3. A minimum 8 GB of available disk space for your IDE, Android SDK and the Android Emulator.

4. 8 GB RAM or more.

5. 1280 x 800 minimum screen resolution.

If your computer meets these requirements then let's get started with the installations.

##Method 1:Manually Installing Android Studio (From the Official & PPA Repositories)

###Installing From the Official Repository
You can install Android Studio from the official repository. To begin, open up your terminal and then update and upgrade your APT repository by running the command below:

```
$ sudo apt update
$ sudo apt upgrade
```
Then install OpenJDK, a free and open-source implementation of the Java platform, Standard Edition (Java SE). To do so run:

```
$ sudo apt install openjdk-18-jdk
```
Now you can proceed to install your IDE by downloading a zip file of the latest version of Android studio on your machine. 

At the time of writing this article, the latest version of Android Studio is the Electric Eel version. Run:

```
$ wget https://dl.google.com/dl/android/studio/ide-zips/2022.1.1.21/android-studio-2022.1.1.21-linux.tar.gz
```
or you can check for the version you want from the [Android Studio Download archive](https://developer.android.com/studio/archive)

After successful download, you need to unpack the downloaded zip file with:

```
$ tar -zxvf android-studio-2022.1.1.21-linux.tar.gz
``` 
Then move the android-studio folder to `/opt/` using:
```
$ sudo mv android-studio /opt/
$ sudo ln -sf /opt/android-studio/bin/studio.sh /bin/android-studio
```
Once you have run these commands, you will write a snippet of code to allow for the Android Studio application to be available on the application menu shortcut on Ubuntu.

Using this command:
```
$ sudo nano /usr/share/applications/android-studio.desktop
```
Add the following code snippet and save:

```
[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Comment=Android Studio
Exec=bash -i "/opt/android-studio/bin/studio.sh" %f
Icon=/opt/android-studio/bin/studio.png
Categories=Development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-android-studio
Name[en_GB]=android-studio.desktop
```
From there you can open and run your android studio from the activities or on the applications menu.

###Uninstalling Android Studio - Official Repository 

If you installed Android Studio from the Official repository, run the following commands to uninstall the IDE:
```
$ sudo rm /usr/share/applications/android-studio.desktop
$ sudo rm -r /usr/bin/android-studio
$ sudo rm -rf /opt/android-studio
$ rm -rf ~/android-studio-2022.1.1.21-linux.tar.gz
```
This will completely uninstall all the packages that were installed.
###Installing Android Studio From the PPA Repository
You can also get your IDE from the PPA repository - an Ubuntu based software repository. To begin install OpenJDK:
```
$ sudo apt install openjdk-18-jdk
```
Check to see the java version installed above:
```
$ java -version
```
Then import PPA and update your APT repository using:
```
$ sudo add-apt-repository ppa:maarten-fonville/android-studio
$ sudo apt update
```
Once complete, you can install Android Studio through:

```
$ sudo apt install android-studio -y
```
###Uninstalling Android studio - PPA repository
If you need to remove Android Studio from your machine, run:
```
$ sudo apt autoremove android-studio --purge -y
```
Then remove the imported PPA using:
```
$ sudo add-apt-repository --remove ppa:maarten-fonville/android-studio -y
```
With this, Android Studio and all the installed packages will have been removed completely
## Method 2: Installing Android Studio Using Snap
Another way you can use to install Android Studio is by using Snap - a package management system by Canonical. To do so, first run:
```
$ sudo apt install snapd
```
Then install OpenJDK and Android Studio using:
```
$ sudo apt install openjdk-18-jdk
$ sudo snap install android-studio --classic
```
Once done, proceed to launch Android Studio by running:

```
$ android-studio
```
###Uninstalling Android Studio - Snap
Removing Android Studio installed using snap is quite easy. You simply need to run:
```
$ sudo snap remove android-studio
```
##Method 3: Installing Android Studio Using JetBrains Toolbox
The third method you can use to install Android Studio is by using the Toolbox app which gives you access to developer products made by Jetbrains.

If you don't know how to install Toolbox, [here is a guide on how to](https://dev.to/janetmutua/installing-jetbrains-toolbox-on-ubuntu-527f).

Once you have Toolbox on your machine, click to open it, then select Android Studio and click install. You will get the latest version of the IDE installed in your machine.

![Download Android Studio](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6zflxn5auzi543nkig2k.png)
If you prefer to install a specific version of Android Studio, you can check the available versions and install the one you prefer.

![Android Studio Versions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlfah81niuezltragvli.png)
##Uninstalling Android Studio - Jetbrains Toolbox
To remove Android Studio just open the Toolbox App and click the menu button adjacent to Android Studio option to see an uninstall option. 

This will remove Android Studio and all the packages that were installed with it.

With that, you can select whichever method suits you and get your IDE setup.
##Bonus Tip: Using Wakatime For Your Coding Productivity!

Enhancing your productivity while coding means that you can get more done and build better software. One such plugin that can increase your productivity is *Wakatime*.

*Wakatime* is used for time tracking meaning you can manage and analyze how much time you spend coding daily. In the spirit of building in public, *Wakatime* can help you share your metrics on Twitter or LinkedIn. 

What's more, you can include your programming metrics on your Markdown file on Github. Once you have installed Android Studio, head over to `Settings/plugins` and search for *Wakatime*. 

Install it and *restart* your IDE, then go ahead and change the world one minute at a time!
##References
[Android Studio download archives](https://developer.android.com/studio/archive)
[Latest version of Android Studio](https://developer.android.com/studio#downloads)
[Ubuntu-Server.com](https://www.ubuntu-server.com/ubuntu/how-to-install-android-studio-on-ubuntu-22-04/)
##Conclusion
In this guide we have covered three ways of installing the Android Studio IDE. Properly setting up your IDE allows you to develop your applications smoothly with no bumps. I hope this article has been of help to you.

Follow me on [Twitter](https://twitter.com/mu_mbua_) and [Medium](https://medium.com/@janetmutua) for more tutorials and guides.

Keep building! 🌟