cordova run

Deploys apps on the platform and devices that you specify.

Prerequisites

Android
  • Cordova for Android requires the Android SDK. See this Android web page.
  • Before you run cordova run, make sure to add both Android Debug Bridge (ADB) and Android command-line tools to the system path.
iOS
The Apple tools that are required to build iOS applications run only on the OS X operating system on Intel based Macintosh computers. Xcode 4.5 (the minimum required version) runs only on OS X version 10.7 (Lion) or later, and includes the iOS 6 SDK (Software Development Kit). To submit apps to the Apple App Store℠, you must work with the latest versions of Apple tools.

Syntax

mfp cordova run [-p|--platform <platform> [-t|--target <target>]]

Parameters

-p|--platform <platform>
Platforms on which you run the project. Valid values: ios and android.
Important: Running this command against the ios platform is only applicable for Mac environments. You can add the iOS platform and build your Cordova app while you are working in another development environment such as Linux or Windows. However, the cordova run command, against ios, must be run from a Mac.
-t|--target <target>
Target platform ID to which you are deploying. Use the device ID for this value. To get the target:
  • Android: Use the adb command: $ adb devices.
  • iOS: Try interactive mode, and save the value to use later in direct mode. You can also run ios-deploy-c.

Usage

  • Interactive mode: $ mfp cordova run
  • Direct mode with <platform> and <target>: $ mfp cordova run --platform android --target ANDROID_DEVICE_ID
  • Direct mode with <platform>: $ mfp cordova run --platform ios