Not Logged In

fxos_appgen 0.4

A tool to generate, and optionally install, an FxOS application with any givenpermissions.

You can install this package from pypi as 'fxos_appgen'.

Requirements============

You must have 'adb' installed.If you need to install adb, seehttps://developer.mozilla.org/en-US/Firefox_OS/Debugging/Installing_ADB

Once installed, add adb to your PATH in your ~/.bashrcor equivalent file, by adding the following line to the file(replacing $SDK_HOME with the location of the android sdk):

PATH=$SDK_HOME:$PATH

Your phone must have Marionette installed on it and running on port 2828. Ifyour phone does not have Marionette installed, you can install it using thisrepository: https://github.com/mozilla-b2g/marionette-extension

To forward Marionette's port to 2828, run::

adb forward tcp:2828 tcp:2828

Setup=====

You should set up and run this tool inside a virtual environment. From theroot directory of your source checkout, run::

virtualenv venv

Then activate the virtualenv::

source bin/activate

To install::

python setup.py install

Usage=====

Once installed, you will have access to 'fxos_appgen' from the command line.

You can run it like so::

fxos_appgen [options] app_name details_file

By default, it assumes 'adb' is on your path and will generate a v1.3 certifiedapp named 'app.zip' in your current working directory. It will not install theapp by default.

To modify this behaviour, use the options listed here::

fxos_appgen --help

You can also use its API as python package. For example, if you wish togenerate and install a simple, all permissions app::

Please see https://github.com/mozilla-b2g/fxos-appgen/blob/master/fxos_appgen/generator.pyto learn about the API available.

Details File================

The details_file must contain the permissions, and may contain the optionaldata.

This file is required, unless you use the --all-permissions option. If you use --all-permissions, then you may pass in this file to define the other optionalfields, but the 'permissions' section of the details_file will be ignored.

To set permissions on your application, you need to pass in a JSON file containing the permissions you wish to include.

Under the reference/ folders, you'll find complete_permissions.json files.These files contain the full list of permissions available for their respectiveFxOS versions. Use these files as references for your own permissions file.

For example, if I wanted to have an app with only "read" access to "contacts"for v1.3, my permissions file will only contain this:: { "permissions": { "contacts":{ "access": "readonly" }, } }

The "access" options take either "readonly", "readwrite", "readcreate" and"createonly".

For more information on permissions, please see https://developer.mozilla.org/en-US/Apps/Build/App_permissions

System Messages (optional)-------------------------

Certain permissions require you to direct system messages to a particular pagein your app. For example, if you have "sms" as a permission, then you likelywant your app to listen for "sms-delivery-success", which will tell your appthat the sms was sent successfully.

By default, if you specify a permission that has related system messages,the app generated will assigned its messages to be received at thelaunch_path. If you would like to change where the messages get received,then you can add a "messages" section to your permissions file and directthe messages the way you like. Here's an example::

For v1.3 builds:https://mxr.mozilla.org/mozilla-b2g28_v1_3/source/dom/messages/SystemMessagePermissionsChecker.jsm#29andhttps://github.com/mozilla-b2g/gaia/blob/v1.3/apps/settings/resources/permissions_table.json