Skip to content

Instantly share code, notes, and snippets.

@lirantal
Last active September 22, 2019 17:26
Show Gist options
  • Save lirantal/736e06a4ba562887a075dfa7698d844d to your computer and use it in GitHub Desktop.
Save lirantal/736e06a4ba562887a075dfa7698d844d to your computer and use it in GitHub Desktop.
# Android SDK setup
## Install Java
```bash
sudo apt-get update
sudo dpkg --add-architecture i386
sudo apt-get install libbz2-1.0:i386
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1
sudo apt-get install openjdk-8-jdk openjdk-8-jre
```
Add JAVA_HOME to path via ~/.bashrc
```bash
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
```
## Install Android Studio
Download ZIP archive for Linux from: https://developer.android.com/studio/install.html
1. move the .zip to /opt
2. extract it
3. chown the folder to your name
4. chmod 777 studio.sh and run it for the installer
Now the android sdk is installed to ~/Android/Sdk
It's preferred to add ~/Android/Sdk folders to your path:
```bash
export PATH=${PATH}:~/Android/Sdk/tools
export PATH=${PATH}:~/Android/Sdk/platform-tools
```
Run `android`, install the images (atom, etc) and then navigate to Tools -> Manage AVDs and create a new image
Make sure to install the android-23 version and confirm it exists in ~/Android/Sdk/platforms/
# Ionic setup
## Pre-requisties
* Node.js v6
* npm v3
# Install latest cordova and ionic from npm
```bash
npm install -g cordova ionic
```
@naujfract
Copy link

Unable to locate package lib32z1 when i run the third command

Its possible if you are running a 32 bits pc, this command is for x64.

@Maccodonaldo
Copy link

Thank you !!!

@rmfranciacastillo
Copy link

rmfranciacastillo commented Nov 3, 2017

Awesome! Worked like a charm. Btw I'm using Ubuntu 17.10.

@armensanoyan
Copy link

Can't open android. writing android in bash I get this


The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager


Invalid or unsupported command "android-27"

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk

it seems like I have problem because of paths but I can't figure out how to fix. I Have tried to export both from .bashrc and .bash_profile.
Can anyone help me ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment