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.