mozilla
Your Search Results

    Gaia tools reference

    This article lists a number of helpful tools available for working with Gaia.

    Note: You can find a number of very useful tips and tricks on debugging Firefox OS at the B2G QA Tips and tricks page.

    Backup/restore/flashing tools

    Tools to backup your profile, etc.

    pc-sync-tool

    The pc-sync-tool is an app available in the Firefox Marketplace that backs up your data/profile. It must be used in conjunction with the Firefox OS assistant add-on for desktop.

    Backup and restore profile

    To backup and restore data you can use our backup_restore_profile.py tool, which is contained in the B2G-flash-tool Git repo.

    1. Clone the above repo (git clone https://github.com/Mozilla-TWQA/B2G-flash-tool.)
    2. Make sure that your phone is connected via USB to your computer, and that ADB (see Important steps to follow first above) and Debugging via USB (in your device's Developer settings) are enabled.
    3. cd into the cloned directory

    To backup data:

    python backup_restore_profile.py -b

    This should save your device profile to a directory called mozilla-profile, in the same directory as the script is located. To restore your backup:

    python backup_restore_profile.py -r

    Note: To display a full list of options for the tool, run it with a -h or --help flag.

    B2G-flash-tool

    The B2G-flash-tool repo also contains many other tools for rapid flashing of new builds to devices and related tasks — ideal for QA work. For example:

    Debugging tools

    Tools that perform debugging functions.

    WebIDE

    Firefox's WebIDE tool deserves a special mention here — as well as just testing and debugging apps, it is also useful for monitoring performance, memory usage, etc. (see Monitoring performance.)

    get_crashreports.sh

    Contained with the the B2G-flash-tool repo, get_crashreports.sh retrieves device crash reports (/data/b2g/mozilla/Crash Reports/.)

    B2G root directory tools

    There are a number of scripts in the B2G root directory that perform various useful debugging functions, such as:

    Other misc tools

    There are a number of helpful tools located in the gaia/tools/ directory, and other places

    png_recompress.sh

    Located at gaia/tools/, png_recompress.sh is a PNG image compressor. You can run it with the following command structure:

    $ ./tools/png_recompress.sh -v bg.png

    This will remove unnecessary metadata and further compress the png; it can save up to 99.5% of the file size, which has a very measurable impact on an app's ZIP size and memory footprint.

    svg_recompress.sh

    Located at gaia/tools/, svg_recompress.sh is an SVG compressor.

    cache_sync.py

    Located at gaia/tools/, cache_sync.py synchronizes the offline cache of an external app into a local directory structure. This should be run from the base directory of an app in gaia/external-apps. It builds a directory for each known origin in the offline cache.

    edit_prefs.sh

    Located in the B2G root directory, edit_prefs.sh provides an easy way to retrieve device prefs.

     

    Document Tags and Contributors

    Contributors to this page: rvdhrvdh, PaulYang, chrisdavidmills
    Last updated by: PaulYang,
    Hide Sidebar