Skip to content

Instantly share code, notes, and snippets.

@carljdp
Last active May 15, 2019 16:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carljdp/246f9e4f343d79de3fc00bad75363804 to your computer and use it in GitHub Desktop.
Save carljdp/246f9e4f343d79de3fc00bad75363804 to your computer and use it in GitHub Desktop.
Installing Android Tools for Meteor

Installation of Android Tools for Meteor

Read the Meteor docs for the latest guide

The Plan

Versions at the time of writing

  • Meteor 1.6.1
  • JDK 9.0.4
  • Android Studio 3.0.1
  • Android SDK Tools
  • Cordova 7.x (Bundled with Meteor)
    • Supports up to Android API Level 25 (Android 7.1.1)
    • Requires Java Development Kit (JDK) 8 or later.
    • Optional read: Cordova's Android Platform Guide

Download & Install the Java Development Kit

Kali Linux

  • Move the downloaded file to an installation directory like /opt sudo mv jdk-9.0.4_linux-x64_bin.tar.gz /opt
  • Unpack the tarball sudo tar zxvf jdk-9.0.4_linux-x64_bin.tar.gz
  • Remove the tarball sudo rm -rf jdk-9.0.4_linux-x64_bin.tar.gz
    Or see the Oracle Linux install Guide

Download & Install the Android Software Development Kit Tools

Android Studio

  • Installation prerequisites
    • sudo apt-get update
    • sudo apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
  • Move the downloaded file to an installation directory like /opt
    • sudo mv android-studio-ide-171.4443003-linux.zip /opt
  • Unpack the tarball
    • sudo unzip android-studio-ide-171.4443003-linux.zip
  • Run installation script
    • /opt/android-studio/bin/studio.sh
  • Remove the tarball (to save disk space)
    • sudo rm -rf android-studio-ide-171.4443003-linux.zip

-- OR --

Android SDK Tools Only

-- OR --

Updating Android Studio or Android SDK

See Android Studio Docs

Set environment variables and add to PATH

See Android SDK Docs

  • ANDROID_SDK_ROOT = Android SDK directory
  • ANDROID_HOME which also use to point to the Android SDK directory, is deprecated.
  • STUDIO_JDK = JDK directory
  • REPO_OS_OVERRIDE = 'linux'
  • Add environment variables to ~/.bashrc (example)
    • Add line to file export HTTP_PROXY=myserver:1981
    • Reload file source ~/.bashrc
    • For WebStorm terminal, rather use .bashrc than .profile (loaded on ui login) or .bash_profile (loaded on non ui login)

.bashrc (example)

# Android
#export ANDROID_HOME="/opt/android-sdk" # ANDROID_HOME is deprecated
#export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
export ANDROID_SDK_ROOT="/opt/android-sdk"
export PATH="$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH"
export STUDIO_JDK="/opt/jdk-9.0.4"
export REPO_OS_OVERRIDE="linux"

# Gradle
export GRADLE_HOME="/opt/android-studio/gradle/gradle-4.1"
export PATH="$GRADLE_HOME/bin:$PATH"

# MongoDB
export MONGODB_HOME="/opt/mongodb"
export PATH="$MONGODB_HOME/bin:$PATH"
  • // TODO Research why export JAVA_HOME="/opt/jdk-9.0.4" might also be required

  • Test your enviroment variables from the terminal you normally run meteor apps (IDE or OS)

    • $PATH

At this point, navigate back to your project directory and try running
meteor run android to check for errors.

// this.Docs TODO
// - make android & sdkmanager executable ?
// - ad to PATH

Install Gradle if it's not found

  • Install Gradle apt-get ... //probably
  • Add to ~/.bashrc
# Gradle
export GRADLE_HOME="/opt/android-studio/gradle/gradle-4.1"
export PATH="$GRADLE_HOME/bin:$PATH"

Mac

/usr/local/Cellar/gradle/3.4

Create a virtual Device

Test your setup

Finally run meteor run android and your are done!

iOS

see

also see

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