Android Studio
Installing Android Studio
-
Download Android Studio
-
Unzip it
unzip android-studio-ide-XXX.XXXXXXX-linux.zip
-
Move it
sudo mv android-studio /opt/google/
-
Create an application launcher icon
echo "[Desktop Entry] Type=Application Name=Android Studio Icon=/opt/google/android-studio/bin/studio.png Exec=/opt/google/android-studio/bin/studio.sh Terminal=false" >> ~/.local/share/applications/android-studio.desktop chmod +x ~/.local/share/applications/android-studio.desktop
Configuring Android Studio
-
Go to File > Settings > Appearance & Behavior
-
System Settings > Updates
- Automatically check updates for > Stable Channel
- Make sure Automatically check updates for is checked
-
Appearance > Theme > Darcula
-
OK
-
-
File > Project Structure > SDK Location > JDK location
- Set to the version of Java you wish to use, for example:
- /usr/lib/jvm/java-7-openjdk-amd64
- /usr/lib/jvm/java-8-openjdk-amd64
- Set to the version of Java you wish to use, for example:
Updating Android Studio
-
Make sure update location is configured (see Configuring Android Studio above)
-
Help > Check for Updates
-
If it says Update and Restart, click that
-
If it says Download, you must update manually:
-
Exit Android Studio
-
Click the latest version and download it
-
Remove the old version of Android Studio (settings won’t be lost, they’re saved in ~/.AndroidStudioX.X)
sudo rm -rf /opt/google/android-studio
-
Use the same instructions above to unzip and move Android Studio
-
Open Android Studio
-
If you get the Complete Installation dialog, select I want to import my settings from a previous version > OK
-
After upgrading, remove the old ~/.AndroidStudioX.X folder to free up space
-
-
-
Install Android SDK updates
-
Help > Check for Updates
-
Click Update Now or Update for any updates
-
-
Reconfigure Android Studio (see Configuring Android Studio above)
Common issues
-
Aidl is missing
-
Failed to import new Gradle project: failed to find Build Tools revision
Android SDK (old)
Installing the old SDK
-
Install prerequisites for 64-bit Ubuntu:
sudo apt-get install -y libc6:i386 libgcc1:i386 libstdc++6:i386 libz1:i386
-
Install Java
sudo apt-get install -y openjdk-6-jdk openjdk-7-jdk
-
Install Eclipse:
-
Download the latest Android SDK standalone tar file:
-
Extract it
tar xvf android-sdk_rX.X.X-linux.tgz
-
Move it
sudo mv android-sdk-linux /opt/google
When setting up the Android SDK, be sure to include the following packages:
- Tools/Android SDK Tools
- Tools/Android SDK Platform-tools
- Tools/Android SDK Build-tools
- Install the latest version
- Under the latest API:
- Documentation for Android SDK
- This will be installed in /path/to/android-sdk-linux/docs
- Sources for Android SDK
- Documentation for Android SDK
- Under whichever API(s) you’re targeting:
- SDK Platform
- ARM EABI System Image
- Extras/Android Support Library
- Install this if you’re using Eclipse
- Extras/Android Support Repository
- Install this if you’re using Android Studio
Creating a new AVD (android virtual device)
- Open the AVD manager
- Click New…
- Under Target, select the version of Android you want the AVD to be
- For Name, name it HVGA_API_16 (using the API version you picked under target)
- Give it an SD Card size of at least 9 MiB
- Give it a device resolution of HVGA
- Click Create AVD
Showing Android SDK buttons in Eclipse
- Window > Customize Perspective… > Command Groups Availability > Check Android SDK and AVD Manager