This sets you up to make two separate targets:
These are the moving parts:
I've structured my directories like so:
b2g-src/
gaia/ # git clone of my gaia fork
mi/ # hg clone of my mozilla-inbound user repo
build/ # build dir that mi will create
b2g/ # git clone of mozilla-b2g/B2G
Follow the steps in the [introduction to Mercurial queues] 6.
Read the [Mercurial queue workflow] 7 documentation.
This is where we will be working on navigator.id
and friends.
First, cd b2g-src; mkdir mi; cd mi
In the mi
directory:
hg init .
hg qinit -c # initializes mercurial queues
Create and edit .hg/hgrc
, filling in your LDAP username correctly:
[paths]
default = ssh://<LDAP_username>@[email protected]/users/jparsons_mozilla.com/b2g-payments-identity/
mozilla-inbound = https://hg.mozilla.org/integration/mozilla-inbound/
Create and edit .hg/patches/.hg/hgrc
[paths]
default = http://hg.mozilla.org/users/jparsons_mozilla.com/b2g-payments-identity
default-push = ssh://hg.mozilla.org/users/jparsons_mozilla.com/b2g-payments-identity
Now you should be able to pull and build:
hg pull
hg update
make -f client.mk
Whoever is managing the shared user repo (me, in this case), would regularly do:
hg pull mozilla-inbound
hg update
make -f client.mk
You have to regularly blow away the ../build
directory. Try that first if make
crashes.
While that runs, set up Gaia.
cd b2g-src
Update with a git pull
.
Build with:
DEBUG=1 make
You need network to build, since packages will be downloaded from nightly.
Now we will use our mozilla-inbound
and gaia
repos to build B2G.
cd $HOME/b2g
We can build either for the device (and flash the build to the phone), or for the desktop. Desktop builds are useful for testing and more rapid development.
Create .userconfig
and add these lines (adjusting paths accordingly):
# Configuration for custom device builds; Desktop builds ignore this.
GAIA_PATH=/path/to/b2g-src/gaia
GECKO_PATH=/path/to/b2g-src/mi
VARIANT=user # 'user' strangely means 'production'
# this option omits the test apps from the phone
If this is your first time flashing a phone, be sure to follow the [preliminary instructions] 2.
Now configure, build, and flash:
./config.sh otoro # assuming otoro is the correct target
./build.sh
./flash.sh
Create a .mozconfig
file containing:
mk_add_options MOZ_OBJDIR=../build
mk_add_options MOZ_MAKE_FLAGS="-j8 -s" # adjust -j for your number of cores
ac_add_options --enable-application=b2g
ac_add_options --disable-libjpeg-turbo
# This option is required if you want to be able to run Gaia's tests
ac_add_options --enable-tests
# turn on mozTelephony/mozSms interfaces
# Only turn this line on if you actually have a dev phone
# you want to forward to. If you get crashes at startup,
# make sure this line is commented.
#ac_add_options --enable-b2g-ril
If it crashes, try blowing away the build dir and makeing again.
Great! You've already built Gaia, so you can just run b2g like so:
build/dist/bin/b2g -profile gaia/profile --no-remote
You should see the emulator appear in all its glory.
Hotkeys:
- ESC for "back" button
- Home for to go to home screen. On the Mac, use Fn + left-arrow
MDN has more about [using the B2G desktop client] 8.