Build Cordova App On Mac

May 31, 2018  Cordova Build Settings for iOS with XCode 10 - Duration: 4:06. How to run cordova (or) Ionic apps to android Device or an emulator - Duration: 1:35. Sundaravel M 35,619 views.

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

Cordova App Development

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.

Install the SDK

There are two ways to download Xcode:

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

    Mac Parallels Transporter for App Store is all new!Parallels Transporter allows you to copy documents, pictures, music, videos, downloads, and Internet bookmarks from a Windows computer to your Mac.Parallels Transporter also migrates your Windows applications. OregonDuck!, OMG this simply moved my PC files to my Mac and it did all the work for meParallels Transporter was amazing. I had been putting off figuring out how to move everything I need on my old PC to my Mac.

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

Cordova

To run the app on your desktop:

However, don’t go for the obvious shortcut, Command+Z — that’s already taken by Undo. Instead, use something like Ctrl+Command+Z. For example, Window Zoom has a window make better use of available screen space, by expanding vertically, or sometimes filling the entire screen.In System Preferences, create a Zoom shortcut by choosing All Applications from Application, and typing Zoom in the Menu Title field. Launch macOS apps and documents with the keyboardRather than bringing up the Dock and clicking on an app or document — or, worse, having to locate it in Finder — you can use the keyboard to launch such things.The built-in way in macOS is Spotlight. Two menu items cannot have the same shortcut, and Undo’s would disappear if you created something new that clashed with it. Mac keyboard shortcut to open apple menu.

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.xcodeprojfile. 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:

  1. Select Xcode → Preferences → Locations.

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

Cordova app development

For further information, consult Apple's documentation:

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