Configure your first build

This article needs a technical review. How you can help.

Clone the B2G repository

We have several useful tools for building Firefox OS, all contained in a single repository. Download these tools via git to create your working directory.

git clone git://github.com/mozilla-b2g/B2G.git && cd B2G

Configure B2G for your device

Now we need to download the source code. The next command will show a list of build targets.

./config.sh

This will display a list of compatible devices. For more information on which devices can be built see the Compatible Devices page.

Valid devices to configure are:

* [LEGACY] AOSP Ice Cream Sandwich base
- emulator
- emulator-x86

* [LEGACY] AOSP Jellybean base
- emulator-jb
- emulator-x86-jb
- nexus-4
- flame

* AOSP KitKat base
- emulator-kk
- emulator-x86-kk
- nexus-4-kk
- nexus-5
- flame-kk
- leo-kk    (Z3 KK)
- aries-kk  (Z3 Compact KK)

* AOSP Lollipop base
- emulator-l
- emulator-x86-l
- nexus-5-l
- nexus-6-l
- flame-l
- leo-l       (Z3 L)
- aries-l     (Z3 Compact L)
- scorpion-l  (Z3 Tablet Compact L)
- sirius-l    (Z2 L)
- honami-l    (Z1 L)
- amami-l     (Z1 Compact L)
- tianchi-l   (T2U L)
- seagull-l   (T3 L)
- eagle-l     (M2 L)
- flamingo-l  (E3 L)

If your device is not (yet) compatible with B2G, see the Porting Guide.

Select your build target by appending it to the ./config.sh command. If you see your target, multiple times choose the variant under the newest AOSP base available. For example to build for the Nexus 5:

./config.sh nexus-5-l

This will download a lot of data (up to 20GB), so we recommend that you perform this task before lunch or even overnight if you have a slow connection.

Proprietary blobs

Unfortunately, every device needs a set of proprietary blobs. The build system will extract the proprietary blobs directly from your device, so before you start your build, you need to plug in your device.

For Nexus devices and Sony devices the build process will also download some blobs directly from Google or Sony, so make sure you follow the on-screen instructions for these devices; you will need to accept a licence agreement.

Build Firefox OS

All you need to do is run:

./build.sh

Next steps

If you built for the emulator, see Run Firefox OS on the emulator

If you built for a device, see Install Firefox OS to a device

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, rolfedh, AdFad666
 Last updated by: chrisdavidmills,