Install system packages:
sudo apt-get install openjdk-8-jdk gradle
Gradle is needed to build cordova project.
Please note that this setup won't work with openjdk-9-jdk !!!
Download Android Studio, unpack it to your favored destination and execute:
./path/to/android-studio/bin/studio.sh
then follow the install wizard, which will install the android-sdk-linux.
Install API versions required for cordova by SDK Manager from Tools -> Android -> SDK Manager
or Configure -> SDK Manager
.
Update your .bashrc
file:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export ANDROID_HOME=$HOME/PathToAndroid/Sdk
Install nvm (optional but preferable):
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# re-log into terminal
nvm install node
Install cordova:
sudo npm i -g cordova
Use latest Node 8.x for better results
git clone --recursive git@github.com:VarnaLab/varnalab-app.git
cd varnalab-app
cordova plugin add cordova-plugin-crosswalk-webview
cordova platform add android
cordova requirements
Please make sure cordova requirements
command pass without error. Here's an example success output:
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-19
Gradle: installed /usr/share/gradle/bin/gradle
Please make sure your phone is connected via USB and Debugging mode is enabled. You will get a notification to accept the computer.
cordova run android
Execute the command then answer the questions. You require to do this once:
keytool -genkey -v -keystore varnalab-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias varnalab-alias
Execute command and upload to Google Play Store:
cordova build android --release -- --keystore=varnalab-release-key.jks --storePassword='store password here' --alias=arnalab-alias --password='alias password here'
To update web app you can pull directly:
cd www
git pull origin master
cd ..