This guide shows how to set up your SDK development environment todeploy Cordova apps for OS X computers. See thefollowing for more detailed platform-specific information:
The command-line tools above refer to versions prior to Cordova 3.0.See The Command-Line Interface for information about thecurrent interface.
Requirements and Support
Choose Tools, Options, Tools for Apache Cordova, and then choose Cordova Tools. Choose Clear Cordova Cache. Close and re-open your project. Choose Build, Clean Solution. Delete the platforms/platform folder, like platforms/android. To re-install vs-tac. Close Visual Studio. Open a command line and type the following command: npm install -g. This article shows how you can build hybrid apps using Apache Cordova in Visual Studio and deploy them to iOS using Parallels. By using Parallels, you can develop Cordova apps using only a Mac. To accomplish this, you’ll need the following: Xcode on OS X; Node JS on OS X; Windows 7 or 8+ Parallels on OS X or a similar virtual machine solution. Cordova-plugin-battery-status cordova-plugin-camera cordova-plugin-device cordova-plugin-dialogs cordova-plugin-file cordova-plugin-geolocation cordova-plugin-inappbrowser cordova-plugin-media cordova-plugin-media-capture cordova-plugin-network-information cordova-plugin-splashscreen cordova-plugin-statusbar cordova-plugin-vibration cordova-plugin-whitelist. Cordova-ios includes a number of scripts that allow the platform to be used without the full Cordova CLI. This development path may offer you a greater range of development options in certain situations than the cross-platform cordova CLI. For example, you need to use shell tools when deploying a custom Cordova WebView alongside native components.
Apple® tools required to build OS X applications run only on the OS Xoperating system on Intel-based Macs. Xcode® 6.0 (the minimum requiredversion) runs only on OS X version 10.9 (Mavericks) or greater, andincludes the OS X SDK (Software Development Kit). To submit apps tothe Apple App Store℠ requires the latest versions of the Apple tools.
You can test all of the Cordova features using the XCode or any otherIDE such as JetBrain's AppCode, butyou need to use XCode to sign before submitting to theApp Store. To sign the apps, you must also be a member of Apple'sOS X Developer Program.
Cordova For Mac Os 10.12
Install the SDK
There are two ways to download Xcode:
MEGA X for macOS 10.13 (High Sierra) and newer runs natively using the Cocoa widget set. MEGA X 10.1 for Windows, macOS, and Linux is available! Version 10.1 adds native 64-bit support for macOS and advanced timing methods. This version of MEGA is developed for use on macOS systems. For using MEGA on other operating systems please go back to the main page and select the appropriate operating system. IMPORTANT: MEGA7 (and earlier) for macOS is a 32-bit application.
Lightweight and unobtrusive MEGA client for your Mac’s status bar. The fact that MEGAsync will reside in your Mac’s menu bar after the installation is, also, not a surprise. One click on its status bar item is enough for you to see the recently updated files and the available storage remaining. Mac OS X Mountain Lion (version 10.8) is the nineth major release of Mac OS X (now named macOS), Apple’s desktop and server operating system for Macintosh computers. OS X Mountain Lion brings a lot of great things from iPhone, iPad, and iPod touch to the Mac. You can send iMessages. Get your Mac in on Game Center. Receive notifications. Or create a free MEGA account. Registered users enjoy an extra 10% free IP quota allowance. Or create an account to participate in our achievement program, where you can earn free storage & transfer quota when installing MEGA apps or inviting friends to MEGA (activation can take several days).
![Mega for mac os x](/uploads/1/2/6/4/126471552/766925408.jpg)
- from the App Store,available by searching for 'Xcode' in the App Store application.
- from Apple Developer Downloads,which requires registration as an Apple Developer.
Once Xcode is installed, several command-line tools need to be enabledfor Cordova to run. From the Xcode menu, select Preferences,then the Downloads tab. From the Components panel, press theInstall button next to the Command Line Tools listing.
Create a New Project
Use the
cordova
utility to set up a new project, as described in TheCordova The Command-Line Interface. For example, in a source-code directory:Run the app
To run the app on your desktop:
And you should see a bordered window with the example app:
You can also use cordova run --help to see additional build and runoptions.
Open a Project in the SDK
Once osx platform is added to your project, you can open it fromwithin Xcode. Double-click to open the
hello/platforms/osx/HelloWorld.xcodeproj
file. The screen should look like this:TIPYou can also use the
open
command to open the XCode project directlyfrom the command line:Common Problems
Deprecation Warnings: When an application programming interface(API) is changed or replaced by another API, it is marked asdeprecated. The API still works in the near term, but is eventuallyremoved. Some of these deprecated interfaces are reflected in ApacheCordova, and Xcode issues warnings about them when you build anddeploy an application.
Missing Headers: Compilation errors relating to missing headersresult from problems with the build location, and can be fixedvia Xcode preferences:
- Select Xcode → Preferences → Locations.
- In the Derived Data section, press the Advanced button andselect Unique as the Build Location as shown here:
This is the default setting for a new Xcode install, but it may be setdifferently following an upgrade from an older version of Xcode.
For further information, consult Apple's documentation:
![Cordova For Mac Os Cordova For Mac Os](/uploads/1/2/6/4/126471552/854496327.png)
- Member Center home pageprovides links to several OS X technical resources includingtechnical resources, the provisioning portal, distribution guidesand community forums.
- The xcode-select command,which helps specify the correct version of Xcode if more than one is installed.
(Mac®, OS X®, Apple®, Xcode®, App Store℠, iPad®, iPhone®, iPod® and Finder® are Trademarks of Apple Inc.)
-->This article shows how you can build hybrid apps using Apache Cordova in Visual Studio and deploy them to iOS using Parallels. By using Parallels, you can develop Cordova apps using only a Mac. To accomplish this, you’ll need the following:
- Parallels on OS X or a similar virtual machine solution
- Visual Studio 2015 with Visual Studio Tools for Apache Cordova installed
Any Mac that can run Mavericks or Yosemite should work with Parallels and Visual Studio, such as a 2013 MacBook Pro.
Configure Parallels
To install Parallels and Windows 8 on your Mac, follow the instructions that come with Parallels. Once you’ve installed Parallels and Windows 8, consider whether you should give your VM extra RAM and storage space, because the default values might not provide optimal performance. The following illustration shows some example settings in Parallels.
In the environment we tested, we gave the VM 2 CPUS and 3 GB RAM with 8 GB RAM on the Mac. This seemed to provide good performance for Windows while still leaving plenty of memory for OS X as well.
Important: Cordova is not designed to run off of network shares and Windows will not allow you to install a Windows app from a fileshare. For this reason, you either need to uncheck the Shared Profileoption in your VM configuration (which causes your Documents folder tooriginate from a share) or choose a location for your app that is ondisk that is local to your VM.
Set up Node.js with remotebuild
Once you’ve got Parallels up and running, you’re ready to set up your Mac. First you need to install Node.js on OS X. Follow the directions at the NodeJS web site to install it.
Once Node.js is installed, get the remotebuild agent. The remotebuild agent allows Visual Studio to communicate with OS X and use your Mac as a build service. You can install the remotebuild agent by opening the Terminal App on your Mac and typing the following command:
The preceding command installs the remotebuild agent for all users of Node.js on your Mac, as well as the taco-remote module for building Cordova projects. If you don't want to allow others to use the remotebuild agent, you can drop the –g flag from the command to install the agent for the current user.
Important: If Node.js displays error messages, you may need to start Xcode first and accept one or more license agreements. Once youdo that, re-run the preceding command.
Make sure you have Parallels running. With remotebuild installed, start the agent by typing the following command in the Terminal App.
Note
By default, your iOS builds will show up in ~/.taco_home/remote-builds/taco-remote/builds.
When you run remotebuild for the first time, the agent asks for permission to install some additional third party packages using the Homebrew package manager.
Next, the agent creates some security certificates and you will see the following information.
You’ll need to use the PIN when you configure the agent in Visual Studio. The remotebuild agent is now up and running. Leave the Terminal App open.
Get the IP address on your Mac
With Parallels running, the most reliable way to connect from Parallels to the Mac side is to use one of the VNIC IP addresses because it generally won’t change between restarts. You can get these IP addresses by going to Terminal App and typing the following command:
Cordova For Mac Os High Sierra
The results should look similar to the following:
Either of the VNIC IP addresses will work. With remotebuild running and a VNIC IP address ready to use, you can open Visual Studio in Parallels and start building on the Mac.
Configure Visual Studio to use remotebuild
![Mac Mac](/uploads/1/2/6/4/126471552/497710593.jpg)
With Visual Studio open in Parallels, choose Tools, then Options. Open Tools for Apache Cordova, and then choose Remote Agent Configuration. Make the following changes to the remote agent settings.
- Set Enable remote iOS processing to True.
- Set Host to one of the vnic IP addresses your obtained previously.
- Use the default Port setting of 3000.
- Set Secure Mode to True.
- Set Security PIN to the PIN displayed when you first ran remotebuild.
Note
Cordova Mac Os Install
If you don’t see Tools for Apache Cordova in the Options dialog box, then you may need to install the tools. In Programs and Features, find Visual Studio 2015 and select Change, then Modify, then make sure that cross-platform tools for HTML/JavaScript (Apache Cordova) is selected. (If the tools are already installed, try selecting Show all settings if it is present at the bottom of the Options dialog box.)
If time expires on your security PIN (10 minutes by default), you may need to regenerate your certificates again.
Build your project for iOS
Next, make sure that your project is set to build for iOS. If you don't see the Solutions Platforms list on your debug toolbar, you can show it by choosing the dropdown arrow at the right of the debug toolbar as shown in the following illustration.
Select iOS in Solution Platforms list. Then select the device you want to build for in the Debug Target list, such as Simulator – iPhone 5.
After you select the device you want, choose the start debugging button (green right arrow). Visual Studio builds your project, handing off iOS build tasks to remotebuild. Once the build completes, remotebuild starts the simulator and loads your app.
Now you have a working hybrid mobile app development environment for iOS using Visual Studio and Parallels. You can develop your Cordova app and easily test it in iOS.
In later development sessions following a shutdown, you will need to restart remotebuild. As described previously, just open the Terminal App in OS X and type the following on the command line:
With that, good luck, and happy travels developing your next mobile app!