Skip to content

FirefoxReality build

Paul Rouget edited this page Nov 23, 2018 · 5 revisions

These steps assume the use of Android Studio. If you don't want to install Android Studio, command line instructions are also provided.

Making a Servo-enabled Firefox Reality build using Servo nightly builds

  1. clone https://github.com/MozillaReality/FirefoxReality/, checkout the upstream servo branch
  2. follow these steps
  3. modify this line to use the desired nightly version
  4. select your flavor (oculus or googlevr) in the "Build Variants" panel (docked at the bottom left of Android Studio)
  5. follow the appropriate build steps for the target platform

Making a Servo-enabled Firefox Reality build using a local Servo build

Follow the above steps, and add to the user.properties file: servoViewLocal=<path/to/servo>/target/armv7-linux-androideabi/release/servoview.aar (where <path/to/servo> is an absolute path to your servo working directory), and replace release with debug as appropriate

If you wish to have WebVR support, flip the dom.webvr.enabled pref, and build servo with ./mach build --android --features googlevr or --features oculusvr. Once the build completes, run ./mach package --android -f googlevr or -f oculusvr

Installing and running a local Firefox Reality build

Pressing the Android Studio "Play" button will build, install and run the apk. But if you want to open a specific URL or only use the command line, you can do (without Android Studio):

  1. Build and install the APK: ./gradlew --no-daemon assembleGooglevrArmDebug installGooglevrArmDebug (change Google to Oculus and Debug to Release when necessary)
  2. run adb shell am force-stop org.mozilla.vrbrowser && adb shell am start -a android.intent.action.VIEW -d "[URL]" org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity to launch with a particular [URL] value as the home page.

Switching from Gecko to Servo.

Firefox Reality will launch using the gecko backend, so be sure to switch to Servo mode in the app before testing Servo behaviour. To do so, in Firefox Reality, go the Developer Options panel in the Settings, and toggle the Servo option (it's persistent across sessions). Then a new button will be added to the navigation bar. Clicking that button will reload the current page with Servo. The Servo button will only show up for whitelisted urls. You can change the whitelist here.

Testing new Servo changes

  1. edit Servo files
  2. run ./mach build --android
  3. rebuild Firefox Reality
  4. reinstall Firefox Reality
  5. launch Firefox Reality
Clone this wiki locally