Skip to content

Instantly share code, notes, and snippets.

@jaredhirsch
Created September 5, 2014 00:17
Show Gist options
  • Save jaredhirsch/00137b5157fd427c691a to your computer and use it in GitHub Desktop.
Save jaredhirsch/00137b5157fd427c691a to your computer and use it in GitHub Desktop.
hacking on gaia / firefox os: how to debug user builds

Sometimes a Gaia bug only shows up in User, not Engineer, builds.

How to get this to a debuggable state?

This works for me for 2.1 aurora builds. It might be wildly inaccurate by the time you read this ^_^

  1. Enable developer menu
  • this recently changed; you have to go into Device information > more information, then scroll to the bottom
  1. Enable ADB and Devtools debugging inside Developer.
  2. Enable debugging of certified apps
  • this uses a very commonly-needed process for adding prefs to a device:
  1. adb root
  2. adb pull /system/b2g/defaults/pref/user.js .
  3. echo 'pref("devtools.debugger.forbid-certified-apps", false);' >> user.js
  4. adb remount
  5. adb push user.js /system/b2g/defaults/pref
  6. adb shell sync && adb reboot
  7. Crack open devtools, click the 'connect to xxx1234' at bottom
  8. Enable connection on device (there's a confirm dialog on the device)
  9. Enter devtools for your certified app of interest
  • important: the source is minified. right-click inside the code pane and use the 'Prettify Source' option to make it readable :-D
@jaredhirsch
Copy link
Author

Actually, after reading the Makefile more closely, I think that you can just add PRODUCTION=1 to the environment for the make command. This should mean that you can do, say, PRODUCTION=1 DEVICE_DEBUG=1 make reset-gaia to generate a build which is "user mode" but also debuggable.

@jaredhirsch
Copy link
Author

  • how to get fxos in user mode to respond to adb
    • enable dev menu (in more information), enable adb debugging, restart it, unlock it, adb devices should find it.
    • sometimes, you can't get the dev menu to appear.
      • reset phone
      • when the phone is just restarting, do "adb devices" repeatedly until you see it.
      • then jump straight into your make command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment