I. Preparing the Environment
1. Install node and NPM;
#npm
2. Install the VUE environment:
3. Install Cordova, website link address: http://cordova.axuer.com/#getstarted br> #npm install-g Cordova
Two. Build a project
1. Create a Vue project;
2. Create a Cordova project in the Vue project file directory
#cordova Create path (folder name) ID (app ID name) name (app name)
Exmple:cordova Create MyProject com.example.myproject Testpro
(this time you can have more folders in the Vue directory)
#cd folder name
#cordova Platform add iOS
#cordova platform add Android
( Commands that run the Add or remove platforms will affect the content of the project platforms, with a subdirectory in each of the specified platforms in this directory
#cordova platform LS (check your current platform settings)
" Note: I am using the device is Mac, because ANDROIDSDK Gredla version too must not error, the solution is to download an up-to-date version of https://gradle.org/install/ ;
then configure the gradle environment;
My native Gradle path is/users/lanjing/downloads/gradle-4.6;
1. Open the Mac terminal and enter in the terminal: OPEN-E. Bash_profile, open the. bash_profile file; If the error says that there is no such file, create a vim ~/.bash_profile;
2. Edit. Bash_ Profile file, enter the following in the. bash_profile file:
gradle_home=/users/zhoujian/gradle/gradle-3.3; (GRADLE's native path)
Export gradle_home
export path= $PATH: $GRADLE _home/bin
3. Save the. bash_profile file, execute the source ~/.bash_profile on the terminal, Update the. bash_profile file to perform gradle-version on the terminal to see if the configuration was successful. Re-entry into Vue's Cordova directory run #cordova platform LS "
to build and run the app, you need to install each SDK you need for the platform;
Three. Prepare for packaging work
1. First modify the index.html of the Vue project and add it between the head