|
|
## Setting up Mobile Development Environment
|
|
## Setting up Mobile Development Environment
|
|
|
|
|
|
|
|
[Mobile Repository](https://gitlab.labranet.jamk.fi/wimma-lab-2019/overflow/ehasa-mobile)
|
|
|
|
|
|
|
|
|
|
### 1. Initial installation
|
|
### 1. Initial installation
|
|
|
|
|
|
|
|
|
Clone the [Mobile Repository](https://gitlab.labranet.jamk.fi/wimma-lab-2019/overflow/ehasa-mobile)
|
|
|
|
|
|
|
You need node installed as specified in [1.2 Node.js - installation](./node)
|
|
You need node installed as specified in [1.2 Node.js - installation](./node)
|
|
|
|
|
|
|
|
First, install npm module react-native-cli:
|
|
First, install npm module react-native-cli:
|
| ... | @@ -23,6 +23,8 @@ tar xzfv android-studio-ide-183.5692245-linux.tar.gz && |
... | @@ -23,6 +23,8 @@ tar xzfv android-studio-ide-183.5692245-linux.tar.gz && |
|
|
./android-studio/bin/studio.sh
|
|
./android-studio/bin/studio.sh
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
You can ignore the warning in terminal about `Failed to load module "canberra-gtk-module"`
|
|
|
|
|
|
|
When asked for installation type choose `custom`
|
|
When asked for installation type choose `custom`
|
|
|
|
|
|
|
|
Make sure the following checkboxes are checked:
|
|
Make sure the following checkboxes are checked:
|
| ... | @@ -49,7 +51,7 @@ sudo apt-get install qemu-kvm -y && |
... | @@ -49,7 +51,7 @@ sudo apt-get install qemu-kvm -y && |
|
|
sudo adduser $USER kvm
|
|
sudo adduser $USER kvm
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Relogin to load the changes.
|
|
Reboot to load the changes.
|
|
|
|
|
|
|
|
### 3. React Native configuration
|
|
### 3. React Native configuration
|
|
|
|
|
|
| ... | @@ -66,7 +68,9 @@ export PATH=\$PATH:\$ANDROID_HOME/platform-tools |
... | @@ -66,7 +68,9 @@ export PATH=\$PATH:\$ANDROID_HOME/platform-tools |
|
|
source ~/.bashrc
|
|
source ~/.bashrc
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
Now we can start the android device:
|
|
Boot up Android Studio again, and start the android device:
|
|
|
|
|
|
|
|
- Start Android Studio with ~/android-studio/bin/studio.sh
|
|
|
|
|
|
|
|
- In android launch menu, choose configure
|
|
- In android launch menu, choose configure
|
|
|
|
|
|
| ... | @@ -75,7 +79,7 @@ Now we can start the android device: |
... | @@ -75,7 +79,7 @@ Now we can start the android device: |
|
|
Inside the mobile repository:
|
|
Inside the mobile repository:
|
|
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
echo "sdk.dir = /home/\$USER/Android/Sdk" > android/local.properties &&
|
|
echo "sdk.dir = /home/$USER/Android/Sdk" > android/local.properties &&
|
|
|
npm i &&
|
|
npm i &&
|
|
|
sudo react-native run-android
|
|
sudo react-native run-android
|
|
|
``` |
|
``` |