Gloria Ideas

Install Android Studio via Sudo Apt

Looking to develop Android apps on your Ubuntu system? You're in the right place. Today, we're going to guide you through installing Android Studio, the official Integrated Development Environment (IDE) for Google's Android operating system, using the command line with sudo apt.

Installing Android Studio in Ubuntu and Other Linux
Installing Android Studio in Ubuntu and Other Linux

Before we dive in, ensure your system is up-to-date by running these commands in your terminal:

Android - Studio
Android - Studio

Installing Java

Before we proceed with Android Studio, we need to install Java, as it's a prerequisite. Open your terminal and run:

sudo apt update vs upgrade: What's the Difference?
sudo apt update vs upgrade: What's the Difference?

sudo apt update
sudo apt install default-jdk

Verify Java Installation

How to get Sudo for Android
How to get Sudo for Android

To verify that Java is installed correctly, run:

java -version

Installing Android Studio

sudo apt update vs upgrade: What's the Difference?
sudo apt update vs upgrade: What's the Difference?

Now that Java is installed, let's proceed with Android Studio. First, download the Android Studio deb package using the wget command:

wget https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2020.3.1.22/android-studio-2020.3.1.22-linux.tar.gz

Extract the Android Studio Tarball

sudo apt update vs upgrade: What's the Difference?
sudo apt update vs upgrade: What's the Difference?

Extract the downloaded tarball using the following command:

tar xvf android-studio-2020.3.1.22-linux.tar.gz

How to Download & Install Android 11 on Windows 10 PC
How to Download & Install Android 11 on Windows 10 PC
Android Studio for beginners, Part 1: Installation and setup
Android Studio for beginners, Part 1: Installation and setup
How to Download & Install Android 11 on Windows 10 PC
How to Download & Install Android 11 on Windows 10 PC
How to Create an Android App With Android Studio
How to Create an Android App With Android Studio
Installing Android Studio in Ubuntu and Other Linux
Installing Android Studio in Ubuntu and Other Linux
Installing Android Studio in Ubuntu and Other Linux
Installing Android Studio in Ubuntu and Other Linux
How To Install Flutter In Android Studio In Windows - AndroidRide
How To Install Flutter In Android Studio In Windows - AndroidRide
How to Create an Android App With Android Studio
How to Create an Android App With Android Studio
How to Get Started With Your First Android App - Tech Recipes
How to Get Started With Your First Android App - Tech Recipes
Getting Started With Android Studio | Envato Tuts+
Getting Started With Android Studio | Envato Tuts+
5 Best Android Studio Plugins
5 Best Android Studio Plugins
Adbwinapi.dll Was Not Found: How to Fix It
Adbwinapi.dll Was Not Found: How to Fix It
How to Fix “Installation Aborted” Error while Installing ROMs on Android (Status 7)
How to Fix “Installation Aborted” Error while Installing ROMs on Android (Status 7)
What Is Doas and How to Install It - Make Tech Easier
What Is Doas and How to Install It - Make Tech Easier
How to start building Android apps on your Android phone using AIDE
How to start building Android apps on your Android phone using AIDE
flutter App Basic Design
flutter App Basic Design
Install Android Studio on Ubuntu 18.04 with Snap and OpenJDK 8 - Kali Linux Tutorials
Install Android Studio on Ubuntu 18.04 with Snap and OpenJDK 8 - Kali Linux Tutorials
Android Studio Keyboard Shortcuts - Lirent.net
Android Studio Keyboard Shortcuts - Lirent.net
How To Make Android Wallpapers App In Android Studio Part 5 - How To Set Background In Android APP
How To Make Android Wallpapers App In Android Studio Part 5 - How To Set Background In Android APP
a recording studio with multiple monitors and keyboards
a recording studio with multiple monitors and keyboards

Move Android Studio to /opt

Now, move the extracted folder to the /opt directory for better management:

sudo mv android-studio /opt/

Create a Desktop Shortcut

For convenience, let's create a desktop shortcut. Create a new .desktop file in /usr/share/applications with the following content:

nano ~/android-studio.desktop

Then, paste the following into the file, adjusting the paths as necessary:

[Desktop Entry]
Type=Application
Name=Android Studio
Comment=The official IDE for Android application development
Exec=/opt/android-studio/bin/studio.sh
Icon=/opt/android-studio/bin/studio.png
Categories=Development;IDE;
Terminal=false

Finally, launch Android Studio using:

android-studio

As you settle into Android Studio, explore and understand its interface. You're now ready to start coding and building your Android apps! Happy coding!

Read Next