Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save telostia/8c69a3da2e867d673331c6230975add0 to your computer and use it in GitHub Desktop.
Save telostia/8c69a3da2e867d673331c6230975add0 to your computer and use it in GitHub Desktop.
Phore Android Build
# If you have not done so, download, install, and open Android Studio
# Install needed tools
brew tap caskroom/versions
brew cask install java8
brew install maven gradle
# Set env to Java 8 in case there are multiple versions
# Add this line to ~/.bash_profile to make it persistent
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
# Change this however you want
WORKSPACE=$HOME/code/src/java/github.com/
# Setup a build environment
mkdir -p $WORKSPACE
cd $WORKSPACE
# build phorej
git clone https://github.com/teneighty/phorej.git
cd phorej
mvn install -Dmaven.test.skip=true
cd $WORKSPACE
mkdir sdk
cd sdk
# setup android and build
wget https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip
unzip sdk-tools-darwin-3859397.zip
export ANDROID_HOME=$(pwd)
export PATH=$ANDROID_HOME/tools/bin/:$ANDROID_HOME/tools/android:$PATH
sdkmanager --update
sdkmanager 'tools' 'build-tools;25.0.2' 'platforms;android-27' \
'extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1' \
'extras;android;m2repository'
# create the simulator image
avdmanager create avd -n phore -k 'system-images;android-27;google_apis;x86' -d pixel
# start the emulator...its a pixel
./emulator/emulator -avd phore &!
# build and install the app
cd $WORKSPACE
git clone https://github.com/teneighty/phore-android.git
cd phore-android
gradle clean build installDebug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment