INSTALL.md 2.27 KB
Newer Older
Laurent's avatar
Laurent committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
How to install a development environment on GNU/Linux (Ubuntu)
==============================================================

You may want to read [this guide on how to setup Android Studio on Ubuntu](https://github.com/uw-it-aca/spacescout-android/wiki/1.-Setting-Up-Android-Studio-on-Ubuntu)

Install and setup kvm
--------------------
```
$ sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
$ sudo adduser your_user_name kvm
$ sudo adduser your_user_name libvirt
```


Download and install Android Studio
-----------------------------------

Download the [latest Android Studio archive](https://developer.android.com/studio/).

```
$ unzip android-studio-ide-xxx.xxxxxx-linux.zip
$ cd android-studio
$ ./bin/studio.sh
```


Clone MyBibApp source code
--------------------------

```
$ git clone  http://git.afi-sa.fr/my-bib-app/my-bib-app.git
```

In AndroidStudio, select "Import existing project" and open my-bib-app folder.

Patrick Barroca's avatar
Patrick Barroca committed
36
Configure a virtual device
Laurent's avatar
Laurent committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
--------------------------

Choose and download an Android image (x86 recommended as it's faster), at least Android 5.1. Create and name a new AVD.

Test emulation
--------------

```
$ ~/Android/Sdk/tools/emulator -avd avd_name
```


Setup your environment for NativeScript
---------------------------------------

Edit the file *~/.bashrc* and add:

```
export ANDROID_HOME=~/Android/Sdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
alias emulator=~/Android/Sdk/tools/emulator
```

You should logout and reopen your desktop session.

Install NativeScript
-------------------

See [NativeScript setup guide](https://docs.nativescript.org/start/quick-setup)

```
$ npm install -g nativescript
```

Then install an Android SDK and check NativeScript does not report any fatal error

```
~/.../my-bib-app$ ANDROID_HOME/tools/bin/sdkmanager "build-tools;25.0.2" 
~/.../my-bib-app$ tns doctor
```

Prepare MyBibApp for building
-----------------------------

Laurent's avatar
Laurent committed
81
```
Laurent's avatar
Laurent committed
82 83 84 85 86 87
~/.../my-bib-app$ MyBibApp/node_modules/nativescript-couchbase
nativescript-couchbase$ npm install
nativescript-couchbase$ npm run-script build
nativescript-couchbase$ cd ../nativescript-zxing
nativescript-zxing$ npm install
nativescript-zxing$ tsc
Laurent's avatar
Laurent committed
88
```
Laurent's avatar
Laurent committed
89 90 91 92

Build and run MyBibApp
---------------------

Laurent's avatar
Laurent committed
93
```
Laurent's avatar
Laurent committed
94 95
~/.../my-bib-app$ tns build android
~/.../my-bib-app$ tns run android
Laurent's avatar
Laurent committed
96
```