Firefox OS

Debugging

Reference: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Debugging/Setting_up

On the phone:

  • Preferences > Devices/Information > More information > Developers > Enable remote debugging.
  • Connect the phone to a regular computer using a USB cable.

On Linux:

# apt-get install android-tools-adb

Example commands (run as root):

adb shell
adb remount
adb pull /system/b2g/webapps/browser.gaiamobile.org/application.zip
adb push application.zip /system/b2g/webapps/browser.gaiamobile.org/application.zip

Changing the default search provider from Bing to Google

Lazyiest method:

mkdir ~/ffos/
cd ~/ffos
adb pull /system/b2g/webapps/browser.gaiamobile.org/application.zip
unzip application.zip

The configurations we want to change are in:

./js/browser.js

But this file seems to get compiled into:

./gaia_build_defer_index.js

So you will probably want to edit both.

Find and replace the following:

DEFAULT_SEARCH_PROVIDER_URL: 'm.bing.com',
DEFAULT_SEARCH_PROVIDER_TITLE: 'Bing',
DEFAULT_SEARCH_PROVIDER_ICON: 'http://bing.com/favicon.ico',

To:

DEFAULT_SEARCH_PROVIDER_URL: 'www.google.com/m',
DEFAULT_SEARCH_PROVIDER_TITLE: 'Google',
DEFAULT_SEARCH_PROVIDER_ICON: 'https://www.google.com/favicon.ico',

If you want to be extra-ocd, you may also want to replace some occurences of "http" with "https".

When you are ready, send back to the device:

adb remount
adb push application.zip /system/b2g/webapps/browser.gaiamobile.org/application.zip
adb reboot

Writing applications

Flashing / upgrading the image

  • apt-get install android-tools-fastboot android-tools-adb
  • (plug in device)
  • download latest image zip from Geeksphone
  • unzip the archive
  • modify flash.sh and replace use of their adb/fastboot binary by global system binaries, i.e. replace ./fastboot by just "fastboot", same for "adb".
  • su or sudo to root
  • ./flash.sh

Notes