cordova emulate

Deploys apps on the platform and emulators that you specify.

Prerequisites

Android
  • Cordova for Android requires the Android SDK. See this Android web page.
  • Before you run cordova emulate, 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 emulate [-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 emulate 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: Use interactive mode and save the value. Or, you can run ios-sim showdevicetypes.

Usage

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