Skip to content
christofferqa edited this page Dec 22, 2017 · 36 revisions

Install instructions

Step 1 on Ubuntu 14 LTS Steps (prerequisites and emulator)

Either follow the below steps, or execute setup.sh.

curl https://raw.githubusercontent.com/cs-au-dk/thor/master/setup.sh > setup.sh && chmod u+x setup.sh && ./setup.sh
  • Installing dependencies:

    sudo add-apt-repository ppa:openjdk-r/ppa
    sudo apt-get update
    sudo apt-get install openjdk-7-jdk openjdk-8-jdk git bison g++-multilib git gperf libxml2-utils make zlib1g-dev:i386 zip \
    gradle curl redis-server dpkg-dev nodejs-legacy npm \
    ack-grep
    
  • Installing the Android SDK(s):

    • Unzip the latest Android SDK from https://developer.android.com/sdk/index.html#Other to /home/USERNAME/android-sdk-linux
    • Launch the Android SDK Manager: ./home/USERNAME/android-sdk-linux/tools/android
    • Install Android SDK Build-tools 21.1.2, Android SDK Build-tools 19.1.0, Android 5.0.1 (API 21), Android 4.4.2 (API 19), Android 4.1.2 (API 16), Android Support Repository, Android Support Library, and Google Repository (including other tools and SDKs that you may need)
  • Setting up an SD card:

    cd /home/USERNAME/android-sdk-linux/tools
    ./mksdcard -l mysd1 1024M /home/USERNAME/android_images/mysd1.img
    
  • Prepare the repository folder (the paths are fixed to the following)

    sudo mkdir -p /Volumes/Android4.4.3/
    sudo chown -R USERNAME /Volumes
    git clone https://github.com/cs-au-dk/thor.git /Volumes/Android4.4.3/thor
    
  • Download the Android images

    curl www.brics.dk/thor/files/android-images.zip -o instrumented.zip
    mkdir -p /Volumes/Android4.4.3/thor/Android/out/target/product/generic_x86
    unzip instrumented.zip -d /Volumes/Android4.4.3/thor/Android/out/target/product/generic_x86
    
  • Final setup

    • In your .bashrc add ANDROID_HOME=/Volumes/Android4.4.3/thor/Android

    • Run the script init.sh in the Android folder:

      cd /Volumes/Android4.4.3/thor/Android
      sudo ./init.sh
      
    • Download the Node.js dependencies

      cd /Volumes/Android4.4.3/thor/BacklogRunner
      npm install
      

Step 2 (KVM) [optional]

You need KVM to be set-up in order to obtain good performance of the emulator. To do this, you can run the script env.sh

curl https://raw.githubusercontent.com/cs-au-dk/thor/master/env.sh > env.sh && chmod u+x env.sh && ./env.sh

Step 3 (building)

Either follow the below steps, or execute compile.sh.

curl https://raw.githubusercontent.com/cs-au-dk/thor/master/compile.sh > compile.sh && chmod u+x compile.sh && ./compile.sh
  • Build the gradle plugin

    cd /Volumes/Android4.4.3/thor/GradlePlugin
    ./gradlew install
    
  • Build the instrumentation folder

    cd /Volumes/Android4.4.3/thor/Instrumentation/SootAndroidInstrumentation
    ./gradlew install
    
  • Build the Espresso wrapper

    Temporarily switch to Java 8 using sudo update-alternatives --config java, while executing the following steps:

    cd /Volumes/Android4.4.3/thor/Robotium2Espresso
    echo "sdk.dir=/home/USERNAME/android-sdk-linux" >> local.properties
    ./gradlew install
    
  • Build every app in the Applications folder (/Volumes/Android4.4.3/thor/Applications)

    • AnyMemo

      echo "sdk.dir=/home/USERNAME/android-sdk-linux" >> local.properties
      ./gradlew assembleProDebug assembleProDebugTest
      
    • Car-Cast, Numix Calculator (com.numix.calculator), Pocket Paint (Paintroid), and Pocket Code (Catroid-latest)

      echo "sdk.dir=/home/USERNAME/android-sdk-linux" >> local.properties
      ./gradlew assembleDebug assembleDebugTest