在 Visual Studio 2015 RTM 中更新 cordova-android@ [英] Updating cordova-android@ in Visual Studio 2015 RTM

查看:23
本文介绍了在 Visual Studio 2015 RTM 中更新 cordova-android@的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建默认的 Cordova TypeScript 项目时,项目默认设置为 cordova-android@4.0.2.

When I create a default Cordova TypeScript project, the project default is set to cordova-android@4.0.2.

我使用的是最新版本 4.1.0,并希望 Visual Studio 2015 默认使用 4.1.0 版本.

I am using the latest version 4.1.0 and would like to have Visual Studio 2015 use 4.1.0 version as default.

我可以在 Visual Studio 中设置 cordova-android 的版本吗?

Can I set the version of cordova-android in Visual Studio?

我不想使用命令提示符为每个项目更新cordova-android.

I would prefer not to update the cordova-android for each project using a command prompt.

有关如何使用命令提示符升级 Cordova Android 4.1.0 的说明:http://cordova.apache.org/announcements/2015/07/21/cordova-android-4.1.0.html

Instructions on how to upgrade Cordova Android 4.1.0 using command prompt: http://cordova.apache.org/announcements/2015/07/21/cordova-android-4.1.0.html

推荐答案

所描述内容的简短版本 在此处的文档中 如下:

The short version of what is described in the docs here is as follows:

在 Visual Studio 中,右键单击 config.xml 并选择查看代码"并在 config.xml 的根元素下添加以下内容

In Visual Studio, right click on config.xml and select "View Code" and add the following under the root element in config.xml

<engine name="android" spec="4.1.0" />

接下来,对于已经在系统上为平台执行构建的项目,您还需要删除旧版本的 Cordova 平台.

Next, for projects where you have already executed a build for the platform on your system, you’ll also need to remove the old version of the Cordova platform.

打开命令提示符并转到您的 Cordova 项目根目录(不是解决方案根目录)并键入以下命令:

Open a command prompt and go to your Cordova project root (not the solution root) and type the following commands:

npm install -g cordova
cordova platform remove android

下次构建时,您现在将使用平台的更新版本.

The next time you build you will now be on the updated version of the platform.

请注意,仅当您在机器上使用旧平台版本构建时才需要删除平台,如果是这样,则是一次性的.

Note removing the platform is only required if you've built using the old platform version on your machine and is a one time thing if so.

这篇关于在 Visual Studio 2015 RTM 中更新 cordova-android@的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆