This article will tell you how to install and run android studio on Linux. It is not similar with Windows and MacOS. If you are beginner to 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 sub folder named android-studio in 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 with Windows or MacOS, you should run the start script in terminal to start it.
- Open a terminal and go to the android studio unzipped folder.
- CD into the bin folder in android-studio folder.
$ ./studio.shcommand in terminal, then you can see the android studio startup as normal. Maybe there are some error message are printed in the terminal but it dose 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 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 as below. 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 android sdk command tool, but sometimes you may need to invoke those android sdk command in terminal, so please follow below steps to add android sdk command execute path in Linux PATH system environment variable value then you can invoke them in command line.
- Get android SDK path from above picture in step 3.
- Run below command to edit the PATH variable value in .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