cordova 打包工具_Cordova:工具安装

cordova 打包工具

Cordova:工具安装 (Cordova: Tools Installation)

Now we start installation of tools on Windows OS, one by one.

现在,我们开始在Windows操作系统上一一安装工具。

安装NodeJS (Installing NodeJS)

First of all we need to download and install NodeJS. You can download it from, here. Scroll down and you will see two download option with title Download for Windows. Download the most stable version of Nodejs. Stable version is prefixed with LTS

首先,我们需要下载并安装NodeJS。 您可以从下载, 这里。 向下滚动,您将看到两个下载选项,标题为Windows下载 。 下载最稳定的Nodejs版本。 稳定版本以LTS为前缀

Once the download is finished, you need to install it. To install, simply double click on the file just downloded. After installation, open cmd and type node -v. If it shows vx.y.z(x,y,z are numbers), then you have succesfully installed it.

下载完成后,您需要安装它。 要安装,只需双击刚下载的文件。 安装后,打开cmd并键入node -v 。 如果显示vx.yz(x,y,z是数字) ,则说明您已成功安装它。

Next type npm -v. If it also shows x.y.z(x,y,z are numbers), then everything is installed correctly.

接下来输入npm -v 。 如果还显示xyz(x,y,z是数字) ,则说明一切都已正确安装。

cordova 打包工具_Cordova:工具安装

If cmd is throwing error, while executing any of the above command, then check it in the Node.JS Command Prompt.

如果cmd抛出错误,则在执行上述任何命令时,请在Node.JS命令提示符中进行检查。



如何打开NodeJs命令提示符 (How to open NodeJs command prompt)

Simply by searching node in the searchbar.

只需在搜索栏中搜索节点即可

cordova 打包工具_Cordova:工具安装

If Nodejs cmd is also throwing error, then you have to remove NodeJS and install it once again and follow the same process.

如果Nodejs cmd也引发错误,则必须删除NodeJS并再次安装它,然后按照相同的过程进行操作。

安装Cordova (Installing Cordova)

Type npm install -g cordova in cmd or node cmd. Once the installation is complete, check it by typing cordova -v.

cmdnode cmd中键入npm install -g cordova 。 安装完成后,通过键入cordova -v检查。

cordova 打包工具_Cordova:工具安装



If it is showing version (x.y.z), then you have succesfully installed cordova.

如果显示版本(xyz),则说明您已成功安装cordova。

cordova 打包工具_Cordova:工具安装

安装Java开发工具包(JDK) (Installing Java Development Kit (JDK))

Follow this link,

点击此链接

cordova 打包工具_Cordova:工具安装

Download X64 .exe jdk for 64 bit windows. Download X86 .exe jdk for 32 bit Windows operating system.

下载X64 .exe jdk,用于64位Windows。 下载适用于32位Windows操作系统的X86 .exe jdk

If you don't know which version of Windows OS you have, just select Properties option from the menu, after a right click on My PC or My Computer.

如果您不知道您使用的是哪个版本的Windows操作系统,只需右键单击“ 我的电脑”或“ 我的电脑” ,从菜单中选择“ 属性”选项。

cordova 打包工具_Cordova:工具安装

There you will see the version no. (16bit, 32bit, 64bit) of your computer/laptop, against the label System type

在那里,您将看到版本号。 (16位,32位,64位)的计算机/笔记本电脑,标签为“ 系统类型”

cordova 打包工具_Cordova:工具安装

After successful installation of JDK. Next step is to add it to our system's path variable.

成功安装JDK之后。 下一步是将其添加到系统的path变量中



如何打开和更新Path变量 (How to open and update Path variable)

Search for environment variable in the serach bar. Choose the option Edit the system environment variables, it will show you a new dialog window.

在搜索栏搜索环境变量 。 选择选项编辑系统环境变量 ,它将显示一个新的对话框窗口。

cordova 打包工具_Cordova:工具安装

Click on the button Environment variables, available at the bottom of the dialog box.

单击对话框底部的“ 环境变量 ”按钮。

cordova 打包工具_Cordova:工具安装



Now add a system variable and name it JAVA_HOME, and add another system variable with the name as, _JAVA_OPTIONS.

现在添加一个系统变量并将其命名为JAVA_HOME ,并添加另一个名为_JAVA_OPTIONS的系统变量。

cordova 打包工具_Cordova:工具安装



To understand the values that we have to assign to the system varibales JAVA_HOME and _JAVA_OPTIONS, please check the addresses specified below:

要了解我们必须分配给系统变量JAVA_HOME_JAVA_OPTIONS的值 ,请检查以下指定的地址:

Address of Java JDK will be c:\Program Files\Java\jdk_(x.y.z_k). Lets assume this to be address 1

Java JDK的地址为c:\Program Files\Java\jdk_(xyz_k) 。 假设这是地址1

Address of 'bin' will be c:\Program Files\Java\jdk_(x.y.z_k)\bin. Lets assume this to be address 2

'bin'的地址将是c:\Program Files\Java\jdk_(xyz_k)\bin 。 假设这是地址2

Address of JRE 'bin' will be c:\Program Files\Java\jre_(x.y.z_k)\bin. Lets assume this to be address 2a

c:\Program Files\Java\jre_(xyz_k)\bin '的地址为c:\Program Files\Java\jre_(xyz_k)\bin 。 假设这是地址2a

cordova 打包工具_Cordova:工具安装



Now add address 1 as the varibale value for variable name, JAVA_HOME. And in the System Variable box, there is a variable with name, path. Add address 2 and address 2a as the variable value for path variable by separating the values with semicolon ;. For Example: address 2;address 2a

现在将地址1添加为变量名称JAVA_HOME的变量值。 在“系统变量”框中,有一个名为path的变量。 通过用分号分隔值,将地址2地址2a添加为路径变量的变量值; 。 例如: 地址2;地址2a

cordova 打包工具_Cordova:工具安装

Next add address 2 and address 2a as the variable values for the User Variable PATH (User variable panel is just above the System Variable).

接下来,添加地址2地址2a作为用户变量PATH的变量值(用户变量面板位于系统变量上方)。

cordova 打包工具_Cordova:工具安装



And add -Xmx512M, as the varibale value for System variable _JAVA_OPTIONS.

并添加-Xmx512M作为系统变量_JAVA_OPTIONS的变量值。

cordova 打包工具_Cordova:工具安装



Save all these changes and restart cmd then type javac -version. If it shows the version, then you have successfully installed Java.

保存所有这些更改,然后重新启动cmd,然后键入javac -version 。 如果显示版本,则说明您已成功安装Java。

cordova 打包工具_Cordova:工具安装

安装Apache Ant (Installing Apache Ant)

Follow this link and download the latest zip file, and extract it wherever you want to keep it.

单击此链接并下载最新的zip文件,然后将其解压缩到您想要保留的位置。

cordova 打包工具_Cordova:工具安装



Let us supose you extracted it in users/[system_name]/ant location.

让我们假设您在用户/ [system_name] / ant位置中提取了它。

cordova 打包工具_Cordova:工具安装



The location of ant will be users/[system_name]/apache_ant_x.y.z (x.y.z will be anything 1.10.1,1.9.7,...). Lets assume this to be address 3

ant的位置为users / [system_name] /apache_ant_x.yz(xyz为1.10.1,1.9.7,...)。 假设这是地址3

The location of bin will be users/[system_name]/apache_ant_x.y.z/bin (x.y.z will be anything 1.10.1,1.9.7,...). Lets assume this to be address 3a

bin的位置将是users / [system_name] /apache_ant_x.yz/bin(xyz将是1.10.1,1.9.7,...)。 假设这是地址3a

Now create a new System variable ANT_HOME and add address 3 as the variable value.

现在创建一个新的系统变量ANT_HOME并添加地址3作为变量值。

cordova 打包工具_Cordova:工具安装



And in path and PATH add address 3a, to the exisiing values, by using a smeicolon ;

路径路径中 ,通过使用smeicolon将地址3a添加到现有值中;

cordova 打包工具_Cordova:工具安装

cordova 打包工具_Cordova:工具安装

After saving all the changes, restart cmd and type ant -v. If it displays the same version number as we downloaded, then you have installed apache ant.

保存所有更改后,重新启动cmd并键入ant -v 。 如果显示的版本号与我们下载的版本号相同,则表明您已安装apache ant。

安装Android SDK (Installation of Android SDK )

Follow this link: https://dl.google.com/android/installer_r24.4.1-windows.exe

遵循此链接: https : //dl.google.com/android/installer_r24.4.1-windows.exe

After installation look for the directory in which Android SDK tools and Platform tools are installed. In my computer it is installed at, C:\Users\[system_name]\

安装后,查找安装Android SDK工具和平台工具的目录。 在我的计算机上,它安装在C:\ Users \ [system_name] \

cordova 打包工具_Cordova:工具安装

Here we have the complete directory structure of Android SDK, out of which 2 directories are important for us, they are:

这里我们有Android SDK的完整目录结构,其中两个目录对我们很重要,它们是:

C:\Users\[User_name]\AppData\Local\Android\android-sdk\tools and C:\Users\[User_name]\AppData\Local\Android\android-sdk\platform-tools"

C:\ Users \ [用户名] \ AppData \ Local \ Android \ android-sdk \ toolsC:\ Users \ [User_name] \ AppData \ Local \ Android \ android-sdk \ platform-tools“



Now create a new System Variable ANDROID_HOME and add only the Android SDK directory as the variable value.

现在创建一个新的系统变量ANDROID_HOME,并仅添加Android SDK目录作为变量值。

cordova 打包工具_Cordova:工具安装



And in path variable, add platform tools directory and tools directory of Android SDK.

路径变量中,添加platform tools目录和Android SDK的tools目录。

cordova 打包工具_Cordova:工具安装



Now save all the changes, restart cmd and type android.

现在保存所有更改,重新启动cmd并键入android

cordova 打包工具_Cordova:工具安装



A new screen will pop up, congrates! you have successfully installed Android SDK.

弹出一个新屏幕,表示感谢! 您已成功安装Android SDK。

cordova 打包工具_Cordova:工具安装



In the new window, check (tick mark) the checkboxes to download only Android SDK tools, Android SDK platform-tools, SDK build tool in tool panel and download SDK platform etc.

在新窗口中,选中(勾号)复选框以仅下载Android SDK工具,Android SDK平台工具,工具面板中的SDK生成工具并下载SDK平台等。

From next lesson we will start with development of App.

在下一课中,我们将开始开发App。

翻译自: https://www.studytonight.com/apache-cordova/tools-installation

cordova 打包工具