User Tools

Site Tools


artmobilis_dev_vm

ArtMobilis dev vm

Virtualbox vm Installation

I have choosen to install Debian 8/Gnome. Android framework needs a lot of diskspace so i have set it to 50GB

debian 8.2

Common tools

apt-get install sudo git curl tmux
tmux is optionnal

Add user to sudo group

su
addgroup myuser sudo
relog to enable the group

Virtualbox guest additions

sudo apt-get install build-essential module-assistant linux-headers-$(uname -r)

  • Use “insert guest additions cd image…” in the virtualbox “Devices” menu
  • Cancel the warning and open a terminal.

cd /media/cdrom0
sh VBoxLinuxAdditions.run

  • Reboot the machine if everything is ok or read the logs if you have a fail
  • Create a virtualbox snapshot ;)

Tools

node.js

#!/bin/bash

# Script to install node.js on a Debian based machine.
# Author : ssm2017 Binder (s.massiaux) for ArtMobilis (http://artmobilis.net)
# Inspired by : https://blog.nraboy.com/2014/09/install-android-cordova-ionic-framework-ubuntu/

# =========================
# set your node.js version
NODEJS_VERSION="4.2.1"
# set your install path
INSTALL_PATH=/opt
# NOTHING SHOULD BE CHANGED UNDER THIS LINE
# =========================================

# exit on any error
set -e

# some variables to get messages in color
ColEscape="\033";
ColReset="${ColEscape}[0m";
ColRedF="${ColEscape}[31m";
ColGreenF="${ColEscape}[32m";
ColYellowF="${ColEscape}[33m";

# check if root
if [[ $EUID -ne 0 ]]; then
  echo -e ${ColRedF}"Error : This script must be run as root."${ColReset} 1>&2
  exit 1
fi

# x86_64 or i686
LINUX_ARCH="$(lscpu | grep 'Architecture' | awk -F\: '{ print $2 }' | tr -d ' ')"

NODE_X64_FILENAME="node-v${NODEJS_VERSION}-linux-x64"
NODE_X86_FILENAME="node-v{NODEJS_VERSION}-linux-x86"
NODE_DOWNLOAD_FOLDER="https://nodejs.org/dist/v${NODEJS_VERSION}"
NODE_FILENAME=""

if [ "${LINUX_ARCH}" == "x86_64" ]; then
  echo -e ${ColYellowF}"Your system is 64bits."${ColReset}
  NODE_FILENAME="${NODE_X64_FILENAME}"
else
  echo -e ${ColYellowF}"Your system is 32bits."${ColReset}
  NODE_FILENAME="${NODE_X86_FILENAME}"
fi

cd /tmp

echo -e ${ColYellowF}"Download the nodejs archive."${ColReset}
wget "${NODE_DOWNLOAD_FOLDER}/${NODE_FILENAME}.tar.gz" -O "nodejs.tgz"

echo -e ${ColYellowF}"Extract the nodejs archive."${ColReset}
tar zxf "nodejs.tgz" -C "${INSTALL_PATH}"

echo -e ${ColYellowF}"Rename the folder to \"node\"."${ColReset}
cd "${INSTALL_PATH}" && mv "${NODE_FILENAME}" "node"

echo -e ${ColYellowF}"Change ownership of the folder."${ColReset}
chown -R root:root "${INSTALL_PATH}/node"

echo -e ${ColYellowF}"Remove the archive."${ColReset}
cd /tmp
rm "nodejs.tgz"

echo "export PATH=\$PATH:${INSTALL_PATH}/node/bin" >> /root/.bashrc

echo -e ${ColGreenF}"Node.js installation complete.."${ColReset}
echo -e "=========================================="
echo -e "Now, add to your user's .bashrc file :"
echo -e "export PATH=\$PATH:${INSTALL_PATH}/node/bin"
echo -e "=========================================="

Android framework

#!/bin/bash

# Script to install Android SDK on a Debian based machine.
# Author : ssm2017 Binder (s.massiaux) for ArtMobilis (http://artmobilis.net)
# Inspired by : https://blog.nraboy.com/2014/09/install-android-cordova-ionic-framework-ubuntu/

# ==================================
# set your Android SDK download path
# Latest Android Linux SDK for x64 and x86 as of 10-16-2015
ANDROID_SDK="http://dl.google.com/android/android-sdk_r24.4-linux.tgz"
# set your install path
INSTALL_PATH=/opt
# NOTHING SHOULD BE CHANGED UNDER THIS LINE
# =========================================

# exit on any error
set -e

# some variables to get messages in color
ColEscape="\033";
ColReset="${ColEscape}[0m";
ColRedF="${ColEscape}[31m";
ColGreenF="${ColEscape}[32m";
ColYellowF="${ColEscape}[33m";

# check if root
if [[ $EUID -ne 0 ]]; then
  echo -e ${ColRedF}"Error : This script must be run as root."${ColReset} 1>&2
  exit 1
fi

# x86_64 or i686
LINUX_ARCH="$(lscpu | grep 'Architecture' | awk -F\: '{ print $2 }' | tr -d ' ')"
 
# Update all software repository lists
apt-get update
 
cd /tmp
 
if [ "${LINUX_ARCH}" == "x86_64" ]; then
  echo -e ${ColYellowF}"Your system is 64bits."${ColReset}
  echo -e ${ColYellowF}"Installing 32 bits libraries."${ColReset}
  # Android SDK requires some x86 architecture libraries even on x64 system
  dpkg --add-architecture i386
  apt-get update
  apt-get install -qq -y libc6:i386 libgcc1:i386 libstdc++6:i386 libz1:i386
else
  echo -e ${ColYellowF}"Your system is 32bits."${ColReset}
fi

echo -e ${ColYellowF}"Download the Android SDK archive."${ColReset}
wget "${ANDROID_SDK}" -O "android-sdk.tgz"

echo -e ${ColYellowF}"Extract the archive."${ColReset}
tar zxf "android-sdk.tgz" -C "${INSTALL_PATH}"

echo -e ${ColYellowF}"Rename the folder to \"android-sdk\"."${ColReset}
cd "${INSTALL_PATH}" && mv "android-sdk-linux" "android-sdk"

echo -e ${ColYellowF}"Change ownership of the folder."${ColReset}
chown -R root:root "${INSTALL_PATH}/android-sdk"

echo -e ${ColYellowF}"Change permissions on folders and files."${ColReset}
chmod -R 755 *

# Install JDK and Apache Ant
echo -e ${ColYellowF}"Install JDK and Apache Ant."${ColReset}
apt-get -qq -y install default-jdk ant

echo -e ${ColYellowF}"Remove the archive."${ColReset}
cd /tmp
rm "android-sdk.tgz"

echo -e ${ColGreenF}"Android sdk extraction complete."${ColReset}

echo -e ${ColYellowF}"Update the sdk (This can take a long time)"${ColReset}
cd "${INSTALL_PATH}/android-sdk/tools"
./android update sdk --no-ui

echo -e ${ColGreenF}"Android sdk installation complete."${ColReset}
echo -e "=========================================="
echo -e "Now, add to your user's .bashrc file :"
echo -e "export ANDROID_HOME=${INSTALL_PATH}/android-sdk"
echo -e "export PATH=\$PATH:\$ANDROID_HOME/tools"
echo -e "export PATH=\$PATH:\$ANDROID_HOME/platform-tools"
echo -e "=========================================="
echo "Restart your session for installation to complete..."

Test your app

  • Go to your device “about” panel using the main account
  • Touch about 7 times the version number field
  • Debugging options appear then enable “usb debugging”
  • Plug the device on your computer (the device should ask you if you are allowing the usb debugging)
  • Run “adb devices” (your device should be listed)
  • Run “cordova run android”
artmobilis_dev_vm.txt · Last modified: by 127.0.0.1