How to Install Android Studio for Linux
In this guide, we will show you how to install Android Studio using Linux.
Download and Install Android Studio
The first tool you need to download is, of course, Android Studio.
You can download Android Studio from the following website:
A green download button will appear and it will automatically detect that you are using Linux.
A terms and conditions window will appear and you need to accept the agreement.
The file will now start to download.
When the file has completely downloaded open a terminal window.
Now type the following command to get the name of the file that was downloaded:
A file should appear with a name which looks something like this:
Extract the zip file by running the following command:
sudo unzip android-studio-ide-143.2915827-d /opt
Replace the android filename with the one listed by the ls command.
Download the Oracle JDK
The Oracle Java Development Kit (JDK) may be available in your Linux distribution’s package manager.
If it is, install the JDK (must be 1.8 or above) using the package manager (i.e. Software Centre, Synaptic etc).
If the JDK isn’t available in the package manager to go to the following website:
As of writing this article, there are downloads available for JDK version 8U91 and 8U92.
We recommend choosing the 8U92 version.
You will see links for Linux i586 and x64 informat and RPM format. The x64 is for 64-bit machines.
If you happen to be using a distribution that uses the RPM package format download the RPM format.
If you are using any other version download the tar.gz version.
To install Java in RPM format run the following command:
rpm -ivh jdk-8u92-linux-x64.rpm
To install Java from thefile follow these instructions:
tar xvf ~/Downloads/jdk-8u92-linux-x64.
Now you need to make sure that this version of Java is the default.
Run the following command:
sudo update-alternatives –config java
A list of Java versions will appear.
Enter the number for the option that has the words jdk in it. For example:
Run Android Studio
To run Android Studio navigate to the /opt/android-studio/bin folder using the cd command:
Then run the following command:
A screen will appear asking whether you want to import settings. Choose the second option which reads as “I do not have a previous version of Studio or I do not want to import my settings”.
This will be followed by a Welcome screen.
Click “Next” to continue
hoose An Installation Type
A screen will appear with options for choosing standard settings or custom settings.
Choose the standard settings option and click “Next”.
The next screen shows a list of components which will be downloaded. The download size is quite large and is over 600 megabytes.
Click “Next” to continue.
A screen may appear stating that you can run the Android emulator in KVM mode.
More files will be downloaded.
Creating Your First Project
A screen will appear with options for creating a new project and opening existing projects.
Choose the start a new project link.
A screen will appear with the following fields:
- Application name
- Company domain
- Project location
For this example change the application name to “HelloWorld” and leave the rest as the defaults.
Choose Which Android Devices to Target
You can now choose which type of Android device you wish to target.
The options are as follows:
- Android Auto
For each option, you can choose the version of Android to target.
If you choose “Phone and Tablet” and then look at the minimum SDK options you will see that for each option you choose it will show you how many devices will be able to run your app.
We chose 4.1 Jellybean as it covers over 90% of the market but isn’t too far behind.
Choose an Activity
A screen will appear asking for you to choose an activity.
An activity in its simplest form is a screen and the one you choose here will act as your main activity.
Choose “Basic Activity” and click “Next”.
You can now give the activity a name and a title.
For this example leave them as they are and click “Finish”.
How to Run Project
Android Studio will now load and you can run the default project that has been set up by pressing shift and F10.
You will be asked to select a deployment target.
The first time you run Android Studio there won’t be a target.
Click the “Create New Emulator” button.
Choose a Device to Emulate
A list of devices will appear and you can choose one to use as a test device.
Don’t worry you don’t need the actual device as the phone or tablet will be emulated by your computer.
When you have chosen a device click “Next”.
A screen will appear with recommended download options. Click the download link next to one of the options for a version of Android at the same SDK as your project target or higher.
This causes a new download to occur.
You will now be back at the choose a deployment target screen. Select the phone or tablet you downloaded and click OK.
Summary and Troubleshooting
You will now see a fully functioning phone boot up in an emulator and your application will load into the window.
You should now follow some tutorials for learning how to develop Android applications.
Whilst running the project you may get a message stating that you need a KVM emulator.
This is a 2 step process. In the first instance reboot your computer and enter your BIOS/UEFI settings and look for emulation. If the option is disabled change the value to enabled and save the changes.
Now within your Linux distribution within a terminal window try the following command:
sudo modprobe kvm_intel
sudo modprobe kvm_amd