Skip to content

Instantly share code, notes, and snippets.

@dhavalv
Last active December 26, 2016 05:28
Show Gist options
  • Save dhavalv/18b015eded92973d70e7678f4f65f21f to your computer and use it in GitHub Desktop.
Save dhavalv/18b015eded92973d70e7678f4f65f21f to your computer and use it in GitHub Desktop.
Develop Iconic application using corodova and build apk file using gradle. Setup environment for iconic application development in Ubuntu 12.04.

Setup environment for iconic app development in Ubuntu 12.04.

  • Install nodejs, ionic & corodova 1.Install nodejs

    curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
    sudo apt-get install nodejs
    sudo apt-get install build-essential
    nodejs -v
    npm -v
    

    2.Install globally iconic & corodova:

    npm install -g cordova ionic
    
  • Install ant as per below command or found latest tar.gz for ant version and extract it.

     wget http://apache.heikorichter.name/ant/binaries/apache-ant-1.8.4-bin.tar.gz
     tar xvfz apache-ant-1.8.4-bin.tar.gz
     sudo mv apache-ant-1.8.4 /usr/local
     export ANT_HOME="/usr/local/apache-ant-1.8.4"
     echo $ANT_HOME
     ant -version
    
  • Install Java and set path in environment:

    1.Installation java:

     sudo apt-add-repository ppa:webupd8team/java
     sudo apt-get update
     sudo apt-get install oracle-java8-installer
    

    2.Edit bashrc file using add below lines then restart terminal:

     nano ~/.bashrc
     export JAVA_HOME=/usr/lib/jvm/java-8-oracle
     export PATH=$JAVA_HOME/bin:$PATH
     source ~/.bashrc
    
  • Download android studio and install it 1.Install libs for android studio:

     sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
    

    2.Download android studio 3.Install depedency and android studio

  • Set environment path of android sdk

    1.Check Path of sdk (open android studio > File > Settings > System Settings > Android sdk > Andoid Sdk Location) 2.Install android 23 from settings 3.set environment ANDROID_HOME(sdk) using export

     nano ~/.bashrc
     export ANDROID_HOME=/home/tasol/Android/Sdk/
     export PATH=${PATH}:/home/tasol/Android/Sdk/platform-tools:/home/tasol/Android/Sdk/tools
     source ~/.bashrc
    
  • Set environment path for gradle 1.Find path using locate cmd locate gradle.bat. 2.export environment path for gradle and check gradle version

     export PATH=${PATH}:/opt/android-studio/gradle/gradle-2.14.1/bin/
     gradle -version
    
  • Iconic app development: 1.create new iconic app with default template(template="tabs/blank/sidemenu")

     ionic start todo blank
    

    2.Before run ionic app, need to define for which plateform ionic app.

     ionic platform android
    

    3.Build apk:

     ionic build android
    
  • final environment paths and ~/.bashrc file:

     # JAVA_HOME
     export JAVA_HOME=/usr/lib/jvm/java-8-oracle
     export PATH=$JAVA_HOME/bin:$PATH
    
     # ANDROID_HOME
     export ANDROID_HOME=/home/tasol/Android/Sdk
     export PATH=$PATH:$ANDROID_HOME/bin
    
     #Android tools path sets in environments:
     export PATH=${PATH}:/home/tasol/Android/Sdk/platform-tools:/home/tasol/Android/Sdk/tools
    
     #set gradle path:
     export PATH=${PATH}:/opt/android-studio/gradle/gradle-2.14.1/bin/
    

Reference Link:

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