Skip to content

Instantly share code, notes, and snippets.

@rook2pawn
Last active February 25, 2019 08:22
Show Gist options
  • Save rook2pawn/471f6fe0b087733cb32bbe9d8a8a35a3 to your computer and use it in GitHub Desktop.
Save rook2pawn/471f6fe0b087733cb32bbe9d8a8a35a3 to your computer and use it in GitHub Desktop.
Step By Step Cordova - Android Env without Studio

Android Cordova Build Environment without Studio

Get Java

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
extract in your home directory Then at the end of your .bashrc

    export JAVA_HOME="$HOME/jdk1.8.0_201"

Get Gradle

https://gradle.org/install/#manually

Download binary only. Extract to home directory Modify your path so that it includes gradle/bin i.e.

  $HOME/gradle-5.2.1/bin

Get Android Platform Command Line Tools Only

https://developer.android.com/studio/index.html#downloads

You will get a .zip file. extract it to your home directory, but create a directory for it to belong in. You can it do it like so

    unzip sdk-tools-linux-4333796.zip -d android-tools

it will create a directory called tools within android-tools. This is the crux of the installation, as the directory CONTAINING tools will be ANDROID_SDK_ROOT This is somewhat unexpected, as you'd think the tools directory would be the ANDROID_SDK_ROOT, but its not. It's the parent directory that is the ANDROID_SDK_ROOT.

Modify your .bashrc

    export ANDROID_SDK_ROOT="$HOME/android-tools/"

And add to your path

    $ANDROID_SDK_ROOT/tools/bin

Which will add sdkmanager to your path.

Use sdkmanager to then add the android version and build tools

source .bashrc or open a new terminal to get your new path going. Use sdkmanager --list to see available downloads. You will want these

  build-tools;28.0.0   | 28.0.0  | Android SDK Build-Tools 28     | build-tools/28.0.0/  
  platform-tools       | 28.0.1  | Android SDK Platform-Tools     | platform-tools/      
  platforms;android-28 | 6       | Android SDK Platform 28        | platforms/android-28/
  tools                | 26.1.1  | Android SDK Tools 26.1.1       | tools/ 

Install all of these like so

    sdkmanager "build-tools;28.0.0"

likewise do the same with "platform-tools", "platforms;android-28" (or whatever android version)

then do sdkmanager --list to see your installed toolset.

Your final PATH statement in your .bashrc

Should look similar to the following

    export PATH="$HOME/bin:$HOME/gradle-5.2.1/bin:$ANDROID_SDK_ROOT/tools/bin:$HOME/android-tools/platform-tools:$PA
TH"

Other imporant links

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