Install Visual Studio Tools for Apache Cordova

时间:2022-09-17 12:03:29

Install Visual Studio Tools for Apache Cordova

Visual Studio 2013
 

This article refers to the Visual Studio Tools for Apache Cordova, which is pre-release software. The features described are in preview and are subject to change. You can download the preview from the Microsoft Download Center.

This article describes how to install the tools and third-party dependencies required for creating cross-platform Cordova apps using Visual Studio Tools for Apache Cordova:

Requirements
Getting the tools
Installing the tools
Installing the dependencies manually
Installing tools for iOS
Overriding system environment variables

Requirements

 
  • One of the following operating systems: Windows 7, Windows 8, Windows 8.1, or Windows Server 2012 R2.

    Install Visual Studio Tools for Apache CordovaImportant

    If you are using Windows 7, you can develop apps for Android and iOS, but not for Windows or Windows Phone.

  • Visual Studio 2013 Update 4 (Professional, Ultimate, Premium, or Community Edition) with the following features installed:

    • Tools for Maintaining Store apps for Windows 8

    • Windows Phone 8.0 SDK

      You can add these features to an existing installation of Visual Studio 2013 Update 4. In Control Panel, choose Programs and Features. Select Visual Studio 2013 from the list, and then choose Change. In the Visual Studio setup window, chooseModify. In the features list, select the two options, as shown in the illustration.

      Install Visual Studio Tools for Apache Cordova

  • If you are using Visual Studio 2015 Preview instead of Visual Studio 2013, see the installation procedure in this topic.

To build apps for specific device platforms, there are a few additional requirements:

Get the tools

 

To get the Visual Studio Tools for Apache Cordova extension, go to the Microsoft Download Center. Follow the steps in the next section to install the extension.

Install Visual Studio Tools for Apache CordovaImportant

If you previously installed a CTP of the Visual Studio Tools for Apache Cordova (Multi-Device Hybrid Apps), you must first uninstall the CTP using Control Panel, Programs and Features before installing the Visual Studio 2013 Update 4 and the current CTP.

In Visual Studio 2015 Preview, Visual Studio Tools for Apache Cordova can be installed as an optional feature during installation. For the installation procedure, see Get started with Visual Studio Tools for Apache Cordova.

Install the tools

 

The installer first installs a patch to Visual Studio to support Cordova app development. Then it gives you the option to install the following third-party software. Most of these are open-source software required by specific platforms or by Apache Cordova.

  • Joyent Node.js enables Visual Studio to integrate with the Apache Cordova Command Line Interface (CLI) and Apache Ripple Emulator.

  • Git CLI is required only if you need to manually add Git URIs for specific Cordova plug-ins.

  • Google Chrome is required to run the Apache Ripple emulator for iOS and Android.

  • Apache Ant 1.8.0 or later is required for the Android build process.

  • Oracle Java JDK 7 is required for the Android build process.

  • Android SDK is required for the Android build process and Ripple.

  • SQLite for Windows Runtime is required to add SQL connectivity to Windows apps (for the WebSQL Polyfill plugin).

  • Apple iTunes is required for deploying an app to an iOS device connected to your Windows PC.

To install the Visual Studio extension and dependencies

  1. Run the installer that you found in Get the tools.

  2. Follow the instructions to install the Visual Studio extension.

  3. When prompted, allow the installer to install third-party software dependencies, or you can clear the software selections and manually install the dependencies you need later.

    Install Visual Studio Tools for Apache CordovaImportant

    If the third-party dependencies are already on your system or you choose to install them manually, you might have to update your system path. See Installing dependencies manually.

    Install Visual Studio Tools for Apache Cordova

  4. Reboot your computer.

    Install Visual Studio Tools for Apache CordovaImportant

    You must reboot to make sure everything is installed correctly.

  5. Open Visual Studio, choose Tools, then Extensions and Updates, and then Updates. If there is a Visual Studio update available for Visual Studio Tools for Apache Cordova, install it.

    Install Visual Studio Tools for Apache CordovaNote

    The first time you build an app after installing the tools, Visual Studio will download and install the Cordova tools. As a result, the first build takes extra time to complete. Check the Output window to see progress.

  6. Before you run your app on the iOS Simulator or an iOS device, you must install the remote agent on a Mac computer. See Install Tools to Build for iOS.

Install dependencies manually

 

If you choose not to install one or more dependencies with the extension, you can install them later manually.

Install Visual Studio Tools for Apache CordovaCaution

You can install the dependencies in any order, except for Java. You must install and configure Java before you install the Android SDK.

Read the following information and use these links to install dependencies manually.

  • Joyent Node.js

    We recommend installing the x86 version of Node.js.

  • Google Chrome

  • Git Command Line Tools

    When you install Git command line tools, select the option that adds Git to your command prompt path.

    Install Visual Studio Tools for Apache CordovaCaution

    Git command line tools 1.9.3 are installed by default. Unexpected failures may occur if you install a version prior to 1.9.0.

  • Apache Ant

    • Download and extract Ant to a location like C:/ant-1.x.x

    • Set the ANT_HOME environment variable to point to the preceding location.

    • Add %ANT_HOME%\bin to the system path.

      Install Visual Studio Tools for Apache CordovaNote

      If you need to set this environment variable manually, see Override system environment variables.

  • Oracle Java 7

    • Set the JAVA_HOME environment variable to C:/Program Files/Java/jdk1.7.0_55

    • Add this to the system path: %JAVA_HOME%\bin

      Install Visual Studio Tools for Apache CordovaNote

      If you need to set this environment variable manually, see Override system environment variables.

  • Android SDK with the following SDK packages:

    • Android SDK Tools (latest version)

    • Android SDK Platform-tools (latest version)

    • Android SDK Build-tools (latest version)

    • Android 4.4.x (API level 19) with the following packages:

      • SDK Platform

      • ARM EABI v7a System Image

      • Intel x86 Atom System Image

      • Google APIs (x86 System Image)

      • Google APIs (ARM System Image)

    The following illustration shows the required packages in the Android SDK Manager.

    Install Visual Studio Tools for Apache Cordova

    Set the ADT_HOME environment variable to the SDK installation location.

    Add this to the system path: %ADT_HOME%\tools;%ADT_HOME%\platform-tools

    If you need to set this environment variable manually, see Override system environment variables.

    Install Visual Studio Tools for Apache CordovaTip

    If you install the Android SDK to its default location on Windows, it gets installed to C:\Program Files (x86)\Android\android-sdk.

  • Apple iTunes (x86x64)

  • SQLite

  • WebSocket4Net (required if you’re developing your app on Windows 7)

    1. Download WebSocket4Net(0.9).Binaries.zip from CodePlex.

    2. From the downloaded zip file, copy net45\Release\WebSocket4Net.dll into the %ProgramFiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\WebClient\Diagnostics\ToolWindows folder on your computer.

Install tools for iOS

 

A few extra steps are required to build and run apps for iOS from Visual Studio. See Install Tools to Build for iOS.

Override system environment variables

 

Visual Studio detects the configurations for the third-party software you’ve installed, and maintains the installation paths in the following environment variables:

  • ADT_HOME points to the Android installation path.

  • ANT_HOME points to the Ant folder on your computer.

  • GIT_HOME points to the Git installation path.

  • JAVA_HOME points to the Java installation path.

Visual Studio uses these environment variables when building and running your app. You can view the environment variables and revise their values through the Visual Studio Options dialog box. You might want to override the default settings for one of the following reasons:

  • Visual Studio was unable to verify the path. In this case, a warning is displayed next to the environment variable.

  • You have multiple versions of the software installed, and you’d like to use a specific version.

  • You want your global environment path to be different from the local Visual Studio environment.

To override the variables

  1. On the Visual Studio menu bar, choose Tools, Options.

  2. In the Options dialog box, choose Tools for Apache Cordova, and then choose Environment Variable Overrides.

  3. Make your changes:

    • To override a value, select its check box, and then revise the value.

      If the path information is invalid or missing, Visual Studio displays a warning next to that variable.

    • To reset an environment variable to its default value, clear its check box or choose Reset to Default.

  4. Choose OK to save your changes and close the dialog box.

Install Visual Studio Tools for Apache Cordova

Manually updating the Cordova version

 

Visual Studio has been test against a specific version of Apache Cordova. We intend to support selecting a Cordova version at a per-project level, but even now it is possible to apply a patch to use a different version of Cordova across all projects on your system.

Install Visual Studio Tools for Apache CordovaCaution

Patching Visual Studio is not officially supported. You may run into unexpected behaviors and we recommend that only advanced users take these steps. The patch makes system-wide changes to your machine.

To update Visual Studio to use a different version of Cordova

  1. After you install Visual Studio Tools for Cordova, create and build a blank project to install Cordova.

  2. Open a command line and type this command:

     
     
    cd %appdata%\npm\node_modules\vs-mda\
    

    If you installed Node.js yourself, vs-mda may be installed in a different location. The preceding command shows the default installation location.

  3. On the command line, type this command:

     
     
    npm install cordova@version --save
    

    where version is the version of the Cordova CLI that you want to use. For example, you might use 4.1.0.

    If you've installed Cordova somewhere else, you can type cordova --version to find out the Cordova version.

    Install Visual Studio Tools for Apache CordovaImportant

    Be sure to omit the -g global switch when you run the preceding install command.

  4. Run a "clean" operation such as Clean Solution on the project you are editing in Visual Studio to make the version change take effect.

To revert to the supported version of Cordova

  • Open a command prompt and type:

     
     
    npm uninstall -g vs-mda
    

    Visual Studio will automatically reinstall vs-mda the next time you build.

    Alternatively, you can search for the vs-mda file under C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions and modify package.json to refer to the version you would like to use. When you are finished modifying package.json, run the following command from same folder:

     
     
    npm install -g vs-mda
    

For iOS build support on your Mac, the version of Cordova that vs-mda-remote uses must match the version that you installed for Visual Studio. The following steps describe how to update vs-mda-remote to use a specific version of Cordova. For complete information on installing iOS build tools, see Install Tools to Build for iOS.

To update vs-mda-remote on your Mac to a different version of Cordova

  1. Open the Terminal app on your Mac and type the following command:

     
     
    cd /usr/local/lib/node_modules/vs-mda-remote
    

    If you did not install vs-mda-remote globally (-g) the location of vs-mda-remote may be different on your Mac.

  2. Type this command:

     
     
    sudo npm install cordova@version --save
    

    where version is the same version of the Cordova CLI you installed previously. For example, this might be 4.1.0.

    Install Visual Studio Tools for Apache CordovaImportant

    Be sure to omit the -g global switch when you run the preceding install command.

    If you installed Cordova somewhere else, you can type cordova --version to find out the Cordova version.

    Run a "clean" operation such as Clean Solution on the project you are editing in Visual Studio to make the version change take effect.

To revert vs-mda-remote on your Mac to the supported version

  1. Open the Terminal app on your Mac and type:

     
     
    sudo npm uninstall -g vs-mda-remote
    
  2. Type the following command:

     
     
    sudo npm install -g vs-mda-remote --save
    

Install Visual Studio Tools for Apache Cordova的更多相关文章

  1. 配置 Visual Studio Tools for Apache Cordova

    原文:配置 Visual Studio Tools for Apache Cordova 1.连接地址 https://msdn.microsoft.com/zh-cn/library/vs/alm/ ...

  2. Visual Studio 2015 和 Apache Cordova 跨平台开发入门(一)

    基于 Windows 10 的 Visual Studio 2015 跨平台的应用开发主要分为基于Visual Studio 安装 Xamarin 扩展的跨Android.iOS 和 Windows的 ...

  3. Visual Studio 2015 和 Apache Cordova 跨平台开发入门

    原文:Visual Studio 2015 和 Apache Cordova 跨平台开发入门(一) 基于 Windows 10 的 Visual Studio 2015 跨平台的应用开发主要分为基于V ...

  4. Visual Studio 2017 and Apache Cordova mobile apps | Andrés Zsögön

    原文:Visual Studio 2017 and Apache Cordova mobile apps | Andrés Zsögön 以下是使用Microsoft Visual Studio 20 ...

  5. Visual Studio 2015 和 Apache Cordova

    英文原版:http://www.codeproject.com/Articles/860150/Visual-Studio-and-Apache-Cordova 在开始前,问一下自己下面这些问题: 熟 ...

  6. 在 Visual Studio中 使用Apache Cordova 开发安卓、iOS程序(自定义图标和闪屏)

    方法1 1台安装有linux的电脑,虚拟机也行,并安装imagemagick软件包.我用的是linux mint,直接在软件管理器中安装即可 把https://github.com/shamork/c ...

  7. 跟我从零基础学习Unity3D开发--Unity3D开发必备神器(Visual Studio Tools for Unity)

    开发Unity3D程序你用的什么IDE呢? 1.MonoDevelop 2.VS 可能你的回答是这样的,我用的vs写代码MonoDevelop来做调试.这时有同学就会反驳了傻X不知道用unityVS吗 ...

  8. 【转】UnityVS(Visual Studio Tools For Unity)的安装与使用

    Unity 的开发者们,尤其是微软系的Unity开发者们,用Mono是不是烦死了?你是不是跟我一样,用vs来写代码,用Mono来跟踪调试?好麻烦啊好麻烦. 也许你会说,傻逼你不会用UnityVS插件么 ...

  9. UnityVS(Visual Studio Tools For Unity)的安装与使用

    首选微软的官方博客地址:http://blogs.msdn.com/b/visualstudio/archive/2014/07/29/visual-studio-tools-for-unity-1- ...

随机推荐

  1. Unity3D Editor 扩展

    官方教程:链接 EditorLayout API:链接 Handles API:链接 1.首先来个Inspector面板Editor的实现 要实现一个组件在Inspector中的Editor功能,首先 ...

  2. Tomcat免安装配置

    大家都知道tomcat吧!因为Tomcat 技术先进.性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了部分软件开发商的认可,成为目前比较流行的Web 应用服务器,也是运行Servlet和JS ...

  3. CodeForces 710A King Moves(水题-越界问题)

    题目链接:http://codeforces.com/problemset/problem/710/A 题目大意:在一个棋盘中给出一个位置,判断该位置周围8个点还有几个点可以摆放棋子. AC代码解释解 ...

  4. 20145236 《Java程序设计》实验一实验报告

    北京电子科技学院(BESTI)实验报告 课程:Java程序设计 班级:1452 指导教师:娄嘉鹏 实验日期:2016.04.08 实验名称:Java开发环境的熟悉(Linux + Eclipse) 实 ...

  5. bzoj 1036 Tree Count

    题目大意:给出一棵树,每个点有一个权值,要求三种操作:1.修改某个点的权值,2.询问x到y路径上各点的权值最大值,3.询问x到y路径上各点的权值之和. #include <cstdio> ...

  6. delphi 01设置 字体属性

    设置/获取 字体属性 名称 大小 粗体 斜体 下划线 删除线 颜色1 颜色2   uses MSHTML;   //设置 //------------------------------------- ...

  7. 社交舞 - 简介&comma;释名&comma;风格&comma;舞步 - 金山词霸汉语 - HAPPY Life

    社交舞 - 简介,释名,风格,舞步 - 金山词霸汉语 - HAPPY Life 社交舞 编辑词条 创建词条 内容来源 社交舞(英语:ballroom dance),又称交谊舞或交际舞,是来源于西方的一 ...

  8. linux命令——iotop

    查看CPU使用情况用top,查看I/O使用情况就需要iotop.这个命令是在 kernel v2.6.20中添加,安装的时候要注意内核的版本号. iotop常用快捷键 1. 左右箭头 --> 改 ...

  9. 【死磕 Spring】----- IOC 之深入理解 Spring IoC

    在一开始学习 Spring 的时候,我们就接触 IoC 了,作为 Spring 第一个最核心的概念,我们在解读它源码之前一定需要对其有深入的认识,本篇为[死磕 Spring]系列博客的第一篇博文,主要 ...

  10. 在鼠标右键上加入使用notepad&plus;&plus;编辑【转】

    我们在安装完notepad++文本编辑器之后,在一个文本文件上右键有时候并没有出现“使用notepad++编辑的选项”,我们可以通过简单地修改注册表文件来增加这样的功能: 1.  首先打开注册表,wi ...