Hybrid app (Cordova) environment configuration record

Source: Internet
Author: User

Node version Management NVM installation process

Because the latest version of node is not compatible with some features, it is necessary to install NVM switch node version

Download Nvm-windows in Https://github.com/coreybutler/nvm-windows

After installation, because the download node speed is too slow, so modify the installation directory Setting.txt file, plus:

Arch:64
Proxy:none
node_mirror:http://npm.taobao.org/mirrors/node/
npm_mirror:https://npm.taobao.org/mirrors/npm/

Then install the required version
NVM Install latest//last version

NVM Install 6.9//Node 6.9

After installation

NVM Use 6.9

Then check to see if the installation was successful

Node-v

If an error occurs, delete the Nodejs folder that was created when you installed the NVM

Routine installation CNPM

NPM install-g cnpm--registry=https://registry.npm.taobao.org

Cordova installation Process

First global installation of Cordova and PHONEGAP (not installed)

CNPM Install Cordova Phonegap-g

Then create a working directory based on the template

Cordova Create app (folder name) Com.example.app app (app name)--template

CD app

CNPM Install//installation dependent

Cordova Platform Add Android//install Android platform

Cordova Plugin Add Cordova-plugin-camera//Camera API

Cordova Requirements//view the running environment and discover the missing SDK

Java SDK, Android SDK, Gradle installation and configuration environment variables

Installing the Java SDK

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Installing the Android SDK

Https://android-sdk.cn.uptodown.com/windows

Decompression Gradle

Https://gradle.org/releases

Adding environment variables

Java_home D:\java (Java SDK installation location)

CLASSPATH%java_home%\lib\dt.jar;%java_home%\lib\tools.jar;

Gradle_home D:\gradle-3.3 (GRADLE mounting position)

Path
%android_home%\platform-tools
%android_home%\tools
%java_home%\bin
%gradle_home%\bin

User Environment variables:

Under the PATH variable:

The Android SDK installs the following files

Configure Simulator ADV

Debugging

Enable ADV debugging while packaging the APK into the app\platforms\android\build\outputs\apk directory

Cordova Run Android

When calling the native API, add the following label to the index.html (the file is in the App\platforms\android\assets\www directory)

<script type= "Text/javascript" src= "Cordova.js" ></script>

Hybrid app (Cordova) environment configuration record

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.