设为首页 收藏本站
查看: 1669|回复: 0

[经验分享] Install Visual Studio Tools for Apache Cordova

[复制链接]

尚未签到

发表于 2015-7-31 13:53:26 | 显示全部楼层 |阅读模式
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.



    http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifImportant

      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.

      http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/dynimg/IC741960.png


  •   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:


  •   Android emulator works best on 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.



    http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifTip

      If you want to build iOS on a cloud service instead of 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 section to install the extension.



http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifImportant

  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





Install dependencies manually




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



http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifCaution

  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.



    http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifCaution

      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


  •   Oracle Java 7


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

    http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/dynimg/IC769719.png  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.



    http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifTip

      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 (x86, x64)

  •   SQLite

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

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

    •   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



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

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

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



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


http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/dynimg/IC771748.png


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.



http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifCaution

  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



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

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

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



    http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifImportant

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



  •   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



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

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



    http://onexin.iyunv.com/source/plugin/onexin_bigdata/https://i-msdn.sec.s-msft.com/areas/global/content/clear.gifImportant

      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



  •   Open the Terminal app on your Mac and type:













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













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



See Also





Concepts


Install Tools to Build for iOS
Other Resources


Download the Tools

FAQ

Known Issues

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-92797-1-1.html 上篇帖子: linux下apache+svn的安装 下篇帖子: Eclipse Apache CXF 集成
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表