Skip to content

Instantly share code, notes, and snippets.

@alexklibisz
Last active March 28, 2019 08:48
Show Gist options
  • Save alexklibisz/f3092d1f4cb907422a62 to your computer and use it in GitHub Desktop.
Save alexklibisz/f3092d1f4cb907422a62 to your computer and use it in GitHub Desktop.
Dev environment setup for Ionic, Cordova, Android Setup
#install nodejs, npm, git
sudo apt-get install nodejs nodejs-legacy npm git -y
#install npm packages
sudo npm install -g cordova
sudo npm install -g ionic
sudo npm install -g ripple-emulator
#download the android sdk (http://developer.android.com/sdk/index.html#Other)
mkdir ~/.software && cd ~/.software
wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
tar xzfv android-sdk_r24.0.2-linux.tgz
cd android-sdk-linux/tools
./android
#in the popup, install all of the auto-selected items, plus API21 -- this will take a while
#add android and tools to the path
head ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
#Android SDK
export PATH=${PATH}:~/.software/android-sdk-linux/tools
export PATH=${PATH}:~/.software/android-sdk-linux/platform-tools
#Add the android platform
cd path/to/app/project
cordova platform add android
#Running/Emulating the App -- all of these assume you're in the project directory
#Run project in the browser
ionic serve
#Run in ripple emulator (browser)
ripple emulate
#Run in desktop app emulator
ionic emulate android
#Deploy to android device for testng
ionic build android
ionic run android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment