This article will tell you how to install and run the android studio on Linux. It is not similar to Windows and macOS. If you are a beginner to the android studio, this is very helpful to you.
1. Install Android Studio On Linux Steps.
- Download related android studio version from android studio official website. It is just a zip file.
- Unzip the download zip file to a local directory for example /home/zhaosong/WorkSpace/Tool/android-studio-ide-181.5056338-linux.
- Please note there is also another subfolder named android-studio in the above folder. Now the android studio has been installed successfully.
2. Start Android Studio On Linux.
Start android studio on Linux is also not similar to Windows or macOS, you should run the start script in the terminal to start it.
- Open a terminal and go to the android studio unzipped folder.
- CD into the bin folder in the android-studio folder.
$ ./studio.shcommand in the terminal, then you can see the android studio startup as normal. Maybe there will have some error messages are printed in the terminal but it does not matter.
3. Specify Android SDK And JDK Path In Android Studio.
When the android studio is started, click File —> New —> New Project to create a new android project. If you want to change the default Android SDK and JDK to other folders, you can follow the below steps.
- Click File —> Other Settings —> Default Project Structure… menu item in the android studio top menu bar.
- Then you can change the android studio project SDK and JDK folder in the popup dialog window SDK Location & JDK location section. If you are a beginner, you do not need to change them at all.
4. Add Android SDK Command Tool In System PATH.
Generally, you will use android studio to run the android SDK command tool, but sometimes you may need to invoke those android SDK commands in the terminal, so please follow the below steps to add android SDK command execute path in Linux PATH system environment variable value then you can invoke them in the command line.
- Get the Android SDK path from the above picture in step 3.
- Run the below command to edit the PATH variable value in the .bashrc file.
# go to user home directory. $ cd ~ # edit .bashrc file to add android sdk command path in PATH system environment variable. $ gedit .bashrc Add below in .bashrc file. export PATH=/home/jerry/WorkSpace/Tool/android-studio-ide-181.5056338-linux/android-studio/bin:/home/jerry/Android/Sdk/platform-tools:/home/jerry/Android/Sdk/tools:$PATH # Run below command to make above change take effect, now you can invoke android tool in command line. $ . .bashrc