Install Visual Studio Tools for Apache Cordova

Source: Internet
Author: User
Tags microsoft download center joyent android sdk manager


Install Visual Studio Tools for Apache Cordova Visual Studio





This article refers to the Visual Studio Tools for Apache Cordova, which is pre-release software. The features described is in preview and is 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, R2.
  • Important

    If you are usin G windows 7, you can develop apps for Android and IOS, but not for Windows or Windows Phone.

  • Visual Studio 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 Update 4. In Control Panel, choose Programs and Features. Select Visual Studio from the list, and then choose . In the Visual Studio Setup window, chooseModify. The features list, select the options, as shown in the illustration.

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


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


    • Android emulator works in computers that can run the Intel HAXM driver. See Run Your Apache Cordova App on Android.

    • Windows Phone emulators require a computer that can run Hyper-V. For more information, see the emulator ' s system requirements.

    • iOS and the iOS Simulator require a MAC computer capable of running Xcode 6 (Xcode 6 is recommended). For additional steps, see Install Tools-to-Build for IOS.

      Tip

      If you want to build iOS on a cloud service instead for MAC hardware, see Build and simulate IOS in the cloud.

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 sections to install the extension.


Important

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 Update 4 and the CU Rrent CTP.


In Visual Studio-Preview, Visual Studio Tools for Apache Cordova can be installed as an optional feature during Insta Llation. 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 your the option to install the following Third-party software. Most of these is 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 E Mulator.

    • 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 was required to add SQL connectivity to Windows apps (for the Websql Polyfill plugin).

    • Apple ITunes is required for deploying a app to a IOS device connected to your Windows PC.

To install the Visual Studio extension and dependencies
  1. Run the installer that's 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.
  4. Important

    If The Third-party dependencies is already on your system or do choose to install them manually, you might has to Updat E Your system path. See Installing dependencies manually.


  5. Reboot your computer.
  6. Important

    You must reboot to make sure everything are installed correctly.


  7. 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.
  8. Note

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


  9. Before your 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.


Caution

You can install the dependencies in any order, except for Java. You must install and configure Java before 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.

    Caution

    Git command line tools 1.9.3 is 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 the preceding location.

    • ADD%ant_home%\bin to the system path.

      Note

      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

      Note

      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) 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.



    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.


    Tip

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

  • Apple ITunes (x86, x64)
  • Sqlite
  • Websocket4net (Required if you ' re developing your apps on Windows 7)
    1. Download websocket4net (0.9). Binaries.zip from CodePlex.

    2. From the downloaded zip file, copy Net45\release\websocket4net.dll to 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 is 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 pat HS 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 are displayed next to the environment variable.

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

    • You want your global environment path to being 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 a environment variable to it default value, clear its check box or Choose reset To Default.

    4. Choose ok to Save your changes and close the dialog box.

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's possible to apply a patch to U Se a different version of Cordova across all projects on your system.


Caution

Patching Visual Studio is not officially supported. You may run to 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 the Visual Studio Tools for Cordova, create and build a blank project to install Cordova.

  2. Open a command line and type the 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 [email protected]--save

    Where version is the version of the Cordova CLI, the want to use . For example, your might use 4.1.0.

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

    Important

    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 is editing in Visual Studio to make the version cha Nge take effect.

To revert to the supported version of Cordova
    • Open a command prompt and type:

      NPM uninstall-g Vs-mda

      Visual Studio would 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\ex Tensions and modify Package.json to refer to the version of you would like to use. 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 of this you Installe D for Visual Studio. The following steps describe how to update vs-mda-remote to use a specific version of Cordova. For the 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_module S/vs-mda-remote 

    If You do not install vs-mda-remote globally (-G) The location of Vs-mda-remote could be different on your mac. 

  2. Type This command:

    sudo npm install [email protected]--save

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

    Important

    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 the Cordova version.

    Run a "clean" operation such as clean solution on the project is editing in Visual Studio to make the version cha Nge 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




See AlsoConceptsinstall Tools to Build for Iosother resourcesdownload the Toolsfaqknown issues


Install Visual Studio Tools for Apache Cordova


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.