jpm-mobile

Add-ons using the techniques described in this document are considered a legacy technology in Firefox. Don't use these techniques to develop new add-ons. Use WebExtensions instead. If you maintain an add-on which uses the techniques described here, consider migrating it to use WebExtensions.

From Firefox 53 onwards, no new legacy add-ons will be accepted on addons.mozilla.org (AMO).

From Firefox 57 onwards, WebExtensions will be the only supported extension type, and Firefox will not load other types.

Even before Firefox 57, changes coming up in the Firefox platform will break many legacy extensions. These changes include multiprocess Firefox (e10s), sandboxing, and multiple content processes. Legacy extensions that are affected by these changes should migrate to WebExtensions if they can. See the "Compatibility Milestones" document for more.

A wiki page containing resources, migration paths, office hours, and more, is available to help developers transition to the new technologies.

You can use jpm and jpm-mobile for Firefox 38 and onwards.

This article is the reference for jpm-mobile.

The Node-based replacement for cfx --force-mobile. Enables you to run and test add-ons for Firefox Mobile (aka Fennec).

jpm usage is:

jpm-mobile [command] [options]

jpm supports the following global options:

-h, --help        - show a help message and exit
-V, --version     - print the jpm version number

Installation

jpm-mobile is distributed using the node package manager npm, so to get jpm-mobile you need to have npm installed, if you haven't already.  npm is included in Node.js, so to install npm, visit nodejs.org and click the Install button.

After that you can install jpm just as you would any other npm package:

npm install jpm-mobile -g

Depending on your setup, you might need to run this as an administrator:

sudo npm install jpm-mobile -g

At the command prompt, type:

jpm-mobile

You should see a screen summarizing the available jpm-mobile commands. Note that unlike cfx, jpm-mobile is available in every command prompt you start, as long as you installed it with the -g flag.

Problems?

If you don't see this, ask for help. SDK users and project team members discuss problems and proposals on the project mailing list. Someone else may have had the same problem you do, so try searching the list. You're welcome to post a question, too. You can also chat with other SDK users in #jetpack on Mozilla's IRC network.

Command reference

There are currently two jpm commands:

jpm-mobile run Launch an instance of Firefox with your add-on installed.
jpm-mobile test Runs your add-on's unit tests.

jpm-mobile run

This command runs a new instance of Firefox with the add-on installed:

jpm-mobile run

jpm-mobile run accepts the following options:

--adb /path/to/adb Provides the path to adb.
-b --binary BINARY

Use the package name of Firefox specified in BINARY.

jpm-mobile run -b fennec

You can get the package name by following command.

$ adb shell pm list packages | grep org.mozilla
package:org.mozilla.firefox
$ jpm-mobile run -b firefox # the package name is firefox
-v --verbose Verbose operation.

jpm-mobile test

 

jpm-mobile test

 

See the tutorial on unit testing and the reference documentation for the assert module for more details on this.

jpm-mobile test accepts the following options:

--adb /path/to/adb Provides the path to adb.
-b --binary BINARY

Use the package name of Firefox specified in BINARY.

jpm-mobile test -b fennec

You can get the package name by following command.

$ adb shell pm list packages | grep org.mozilla
package:org.mozilla.firefox
$ jpm-mobile run -b firefox # the package name is firefox
-v --verbose Verbose operation.

Document Tags and Contributors

 Contributors to this page: wbamberg, Askeing, evold
 Last updated by: wbamberg,