npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

grunt-cordova-ng

v0.2.7

Published

Apache Cordova grunt plugin.

Downloads

66

Readme

grunt-cordova-ng v0.2.5 Build Status

Apache Cordova grunt plugin.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-cordova-ng --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-cordova-ng');

Cordova Task

Run this task with the grunt cordova command.

Task targets, files and options may be specified according to the Grunt Configuring tasks guide.

| Task | Action | | --------------------- | ------------------------------------------------------------ | | cordova:prepare | Run cordova prepare command. | | cordova:compile | Run cordova compile command. | | cordova:build | Run cordova build command. | | cordova:package-files | Copy apk and app to dist directory. | | cordova:package | Run cordova build command and cordova:package-files task | | cordova:emulate | Run cordova emulate command. | | cordova:run | Run cordova run command. | | cordova:platform | Run cordova platform command. | | cordova:plugin | Run cordova plugin command. |

Package files Task (Android and iOS and Firefox OS only)

Run this task with the grunt cordova:package-files or grunt cordova:package command.

Copy *.apk or *.app to dist directory, if run cordova:package-files or cordova:package task.

grunt cordova:package
Running "cordova:package" (cordova) task

Running "cordova:build" (cordova) task
...

Running "cordova:package-files" (cordova) task
Copy to dist/android/CordovaApp-debug-unaligned.apk.
Copy to dist/android/CordovaApp-debug.apk.
Copy to dist/ios/emulator/HelloCordova.app.

Done, without errors.
...

When iOS device build, ipa file is created.

grunt cordova:package --cordova-platforms=ios --cordova-device=device
Running "cordova:package" (cordova) task

Running "cordova:build" (cordova) task
...

Running "cordova:package-files" (cordova) task
Copy to dist/ios/device/HelloCordova.ipa.

Done, without errors.

When Firefox OS, package.zip and www file is created.

grunt cordova:package
Running "cordova:package" (cordova) task

Running "cordova:build" (cordova) task
Cleaning Firefoxos project
Firefox OS packaged app built in platforms/firefoxos/build/package.zip

Running "cordova:package-files" (cordova) task
Copy to dist/firefoxos/package.zip.
Copy to dist/firefoxos/www.

Done, without errors.

Post sign script

If you run cordova:package and cordova:package-files task, post sign script generated.

Android

Generate a private key.

keytool -genkey -v -keystore ~/HelloCordova.keystore -alias HelloCordova -keyalg RSA -keysize 2048 -validity 10000
chmod 600 ~/HelloCordova.keystore

Create a config file. (./resources/android/config)

KEYSTORE=~/HelloCordova.keystore
KEYALIAS=HelloCordova

Run cordova:package task.

grunt cordova:package --cordova-platforms=android --cordova-build=release

Run post sign script.

./dist/android/distribute
Enter Passphrase for keystore: ******

...

Verification succesful

dist/android/CordovaApp-release.apk is created.

iOS

Modify cordova iOS platform platforms/ios/cordova/build-release.xcconfig. Comment CODE_SIGN_*.

...

//
// XCode Build settings for "Release" Build Configuration.
//

#include "build.xcconfig"

//CODE_SIGN_IDENTITY = iPhone Distribution
//CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution

Download distribution provisioning profile from Member Center Provisioning Profiles. And copy to ./resources/mobileprovisions/release.mobileprovision.

mkdir -p ./resources/mobileprovisions
cp ~/Download/distribution.mobileprovision ./resources/mobileprovisions/release.mobileprovision

Run cordova:package task.

grunt cordova:package --cordova-platforms=ios --cordova-build=release --cordova-device=device

Run post sign script.

./dist/ios/distribute

...

Results at '/path/to/project/dist/ios/HelloCordova.ipa'

dist/ios/HelloCordova.ipa is created.

If you want to use the other provisioning profiles, you can use the "--mobileprovision" argument.

cp ~/Download/adhoc.mobileprovision ./resources/mobileprovisions/adhoc.mobileprovision
grunt cordova:package --cordova-platforms=ios --cordova-build=release --cordova-device=device

./dist/ios/distribute --mobileprovision=adhoc

Cordova Platform Task

Run this task with the grunt cordova:platform command.

# list cordova platforms.
grunt cordova:platform:list

# add cordova platform.
grunt cordova:platform:add:android

# remove cordova platform.
grunt cordova:platform:remove:android

# update cordova platform.
grunt cordova:platform:update:android

# check cordova platforms.
grunt cordova:platform:check

Cordova Plugin Task

Run this task with the grunt cordova:plugin command.

# list installed plugins.
grunt cordova:plugin:list

# search plugins.
grunt cordova:plugin:search:console

# add cordova plugin.
grunt cordova:plugin:add:org.apache.cordova.console

# remove cordova plugin.
grunt cordova:plugin:remove:org.apache.cordova.console

Options

projectRoot

Type: String Default: empty

Cordova project root path.

platforms

Type: Array String Default: empty array

Building with cordova platforms.

build

Type: debug release Default: empty string

Bulding type. Use --debug or --release cordova option.

device

Type: device emulator Default: empty string

Device type. Use --device or --emulator cordova option.

target

Type: 'String' Default: empty string

Run or emulate target id. Use --target= cordova option.

debugOptions

Type: 'Object' Default: not defined

Debug build's options.

releaseOptions

Type: 'Object' Default: not defined

Release build's options.

Environment options

It is possible to override the set in the environment variables.

# cordova emulate ios --target=iPad
export GRUNT_CORDOVA_NG_PLATFORMS=ios
export GRUNT_CORDOVA_NG_TARGET=iPad
grunt cordova:emulate

| Environment Name | Value | | -------------------------- | ----------------------------------------- | | GRUNT_CORDOVA_NG_PLATFORMS | ios,android (Comma separated platforms) | | GRUNT_CORDOVA_NG_BUILD | debug or releaase | | GRUNT_CORDOVA_NG_DEVICE | device or emulator | | GRUNT_CORDOVA_NG_TARGET | iPad (Cordova Target) |

Grunt arguments

It is possible to override the set in the grunt arguments.

# cordova emulate android --target=avd1
grunt cordova:emulate --cordova-platforms=android --cordova-target=avd1

| Environment Name | Value | | ------------------- | ----------------------------------------- | | --cordova-platforms | ios,android (Comma separated platforms) | | --cordova-build | debug or releaase | | --cordova-device | device or emulator | | --cordova-target | iPad (Cordova Target) |

Using Example

Build options

In this example, running cordova build android --release.

// Project configuration.
grunt.initConfig({
  cordova: {
    options: {
      platforms: 'android',
        build: 'release'
    }
  }
});

And run.

grunt cordova:build

Release or debug build

To the release build. (Run cordova build --release --device.)

grunt cordova:build:release

To the debug build. (Run cordova build --debug --emulator.)

grunt cordova:build:debug

Can use in any other command.

grunt cordova:emulate:debug

To change release or debug build options.

// Project configuration.
grunt.initConfig({
  cordova: {
    options: {
      releaseOptions: {
        build: 'release',
        device: 'device'
      },
      debugOptions: {
        build: 'debug',
        device: 'emulator'
      }
    }
  }
});