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.
Tools to backup your profile, etc.
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.
- Clone the above repo (
git clone https://github.com/Mozilla-TWQA/B2G-flash-tool.)
- 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.
- 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
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:
- flash_pvt.py — The main tool for flashing new builds.
- change_channel.sh — Allows you to quickly change a phone's update channel.
- check_versions.py — Returns the version og B2G installed on a device.
- shallow_flash.sh — Shallow flashes Gaia and/or Gecko onto a device (shallow_flash.bat available for Windows, too).
- update_system_fonts.sh — Updates the system fonts on B2G v2.1 (bug 1032874).
Tools that perform debugging functions.
B2G root directory tools
There are a number of scripts in the B2G root directory that perform various useful debugging functions, such as:
- run-gdb.sh: Runs the gdb command line debugger (see Debugging B2G using gdb and related tools for more details.)
- run-valgrind.sh: Runs the Valgrind debugger (see Debugging B2G using Valgrind for more information.)
- watch-procrank.sh: Returns memory consumption information via the procrank tool.
Other misc tools
There are a number of helpful tools located in the gaia/tools/ directory, and other places
$ ./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.
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.