dev:install
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| dev:install [2021/12/25 19:56] – sbestel | dev:install [2021/12/25 19:58] (Version actuelle) – sbestel | ||
|---|---|---|---|
| Ligne 6: | Ligne 6: | ||
| * Ma première application Firefox OS : [[https:// | * Ma première application Firefox OS : [[https:// | ||
| * https:// | * https:// | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Linux + Android | ||
| + | # | ||
| + | |||
| + | You will need Node, NativeScript CLI (command line interface), Android Studio and a JDK (java development kit). | ||
| + | |||
| + | Android Studio is not strictly necessary — however it provides an easy to use interface for installing and managing the Android SDKs. | ||
| + | |||
| + | To install Node follow the instructions specific to your Linux distribution. We recommend using the latest version, however anything above Node 12 should be fine. | ||
| + | |||
| + | Note | ||
| + | |||
| + | We have gone through these steps on Ubuntu 20.04 and noted commands we've used, however depending on your Linux distribution, | ||
| + | |||
| + | # On Ubuntu 20.04, we used the following command to install latest node | ||
| + | |||
| + | curl -fsSL https:// | ||
| + | |||
| + | sudo apt-get install -y nodejs | ||
| + | |||
| + | To confirm Node is installed correctly, run: | ||
| + | |||
| + | node -v | ||
| + | |||
| + | npm -v | ||
| + | # Should print something like | ||
| + | v15.x.x | ||
| + | 7.x.x | ||
| + | |||
| + | A JDK version 8 or greater is required, and you have a couple options: | ||
| + | |||
| + | OpenJDK — can be downloaded from AdoptOpenJDK or your system package manager. | ||
| + | Oracle JDK — can be downloaded directly or through the system package manager. | ||
| + | |||
| + | # On Ubuntu 20.04, we used the following command to install OpenJDK 14 | ||
| + | sudo apt-get install -y openjdk-14-jdk | ||
| + | |||
| + | To confirm JDK is installed correctly, run: | ||
| + | |||
| + | java --version | ||
| + | |||
| + | javac --version | ||
| + | # Should print something like | ||
| + | openjdk 14.0.2 2020-07-14 | ||
| + | OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04) | ||
| + | OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, | ||
| + | |||
| + | javac 14.0.2 | ||
| + | |||
| + | Setting up the Android development environment can be daunting if you are new to Android development, | ||
| + | |||
| + | Download and install Android Studio. In the installation wizard make sure to have the following components selected (the list should appear if you select custom options): | ||
| + | |||
| + | Android SDK | ||
| + | Android SDK Platform | ||
| + | Android Virtual Device | ||
| + | |||
| + | The setup may take a while, but once it has finished a welcome screen should appear. | ||
| + | |||
| + | Android Studio installs the latest Android SDK by default, which in most cases should be all that's needed to build a NativeScript app. | ||
| + | |||
| + | Configure the ANDROID_HOME environment variable for NativeScript to be able to find the Android SDK, and add the required tools to path. | ||
| + | |||
| + | Add the following lines to your shell profile, usually ~/ | ||
| + | |||
| + | export ANDROID_HOME=$HOME/ | ||
| + | export PATH=$PATH: | ||
| + | |||
| + | Install the NativeScript CLI globally: | ||
| + | |||
| + | npm install -g nativescript | ||
| + | |||
| + | Note | ||
| + | |||
| + | Depending on how you installed Node, you may get an EACCESS: permission denied error when trying to install a global package. It's generally not recommended to run npm with sudo, see this guide for Resolving EACCESS permissions errors. | ||
| + | |||
| + | To verify if the installation was successful, open a new Command Prompt window to ensure the new environment variables are loaded and run | ||
| + | |||
| + | ns doctor android | ||
| + | |||
| + | If you see No issues were detected you have successfully set up your system. | ||
| + | Preparing an Android device | ||
| + | # | ||
| + | |||
| + | To run a NativeScript app, you will need an Android device — either a physical or a virtual device. | ||
| + | |||
| + | Using a physical device: Connect the device using a USB cable, and follow the instructions from Running on a physical device | ||
| + | |||
| + | Using a virtual device: Open Android Studio, and open "AVD Manager" | ||
| + | |||
| + | If the list of available Virtual Devices is empty, you will need to create a new AVD. Click on " | ||
dev/install.1640462215.txt.gz · Dernière modification : 2021/12/25 19:56 de sbestel
