Building AOSP for the Nexus One

Please Note: Messing around with the firmware and OS on any device can render the device unusable. Please do not attempt to modify your firmware or OS unless you are confident you know what you are doing. I offer no guarantees and do not accept any liability for anything which may go wrong if you follow the information in this post.

Here is my modified version of the instructions from the AOSP page for building for the HTC Dream range of ‘phones to cover the Nexus One Android 2.2 (Froyo) AOSP build process;

  1. Make sure you have a Nexus One running Froyo (FRF91 is the current build). It would be nice to be able to build everything from source, but, unfortunately, there are some copyrighted files needed to build the Nexus One AOSP froyo build which have to be copied from an existing Froyo installation on a Nexus One.

  2. Make sure the Nexus One you wish to run the AOSP build on has had its’ boot loader unlocked. This is a one-way process, once unlocked it can not be re-locked and it will be obvious to anyone using the ‘phone that it has been unlocked (due to the open padlock which appears on the boot screen). Instructions on how to unlock your boot loader can be found in many places.

  3. Follow the normal steps to setup repo and check out the sources. You want to check out the froyo branch, so don’t forget to use “-b froyo” on the repo init command.

  4. At the root of your source tree, run “. build/” like you normally would for an emulator build.

  5. Run “make adb” if you don’t already have adb in your path.

  6. Run “adb root” either as root or using sudo.

  7. Connect your Nexus One running the stock Froyo build to your computer and run the script called “” in device/htc/passion/ from that directory. This will extract some proprietary binaries from your device. You only need to do this once.

  8. Run “lunch full_passion-userdebug” to specifically configure the build system for Nexus One The default is the equivalent of “lunch generic-eng”, which doesn’t contain Nexus One specific files.

  9. Run “make” from the top of the source tree.

  10. **If the build stops with an error about being unable to find librpc then do the following;

  • Run “make librpc” from the top of the source tree.

  • Run “make” again from the top of the source tree.** ** Do not run make clean at any point. **

    1. Make sure the phone you wish to install the AOSP build onto is turned off.

    2. Boot the phone you wish to install AOSP on into fastboot mode. You can do this by holding down the volume down key whilst pressing the power key until a screen which has 3 skateboarding androids at the bottom of it appears. Wait a further 15 to 30 seconds whilst the system checks for some files, and then press the power button again to select fastboot mode. When your in fastboot mode you will see FASTBOOT shown in white text on a red background about 1/4 of the way down the screen.

    3. Connect the ‘phone to the machine you’ve just compiled the AOSP build on using a USB cable.

    4. From the top of the source tree, in the same window you built the code in, run the fastboot tool to flash the AOSP build onto the device by running “fastboot -w flashall”.

Your Nexus One should now be running the AOSP version of Froyo. There is an easy way to tell, if the search widget has a “g” then it’s still running the stock build. If it has a magnifying glass then it’s the AOSP build.

If you have any problems please read the notes below;


  • You may need to run the fastboot comment as root or using sudo. If you do need to do this please ensure you run the version of fastboot from the source tree which is located in at out/host/{host-type}/bin/fastboot where {host-type} will vary depending on the type of machine you’ve compiled AOSP on.

  • If you receive the error message “error: neither -p product specified nor ANDROID_PRODUCT_OUT set” you should run fastboot in the following way from the top of the source tree; “out/host/{host-type}/bin/fastboot -p passion -w flashall” where {host-type} will vary depending on the type of machine you’ve compiled AOSP on.

  • If you receive an error message about the baseband being out of date you have two options;

  • Update the ‘phone to the latest Froyo build before trying to install the AOSP build (the latest baseband is part of the stock froyo update).

  • Install each of the image files by hand. This is not recommended because you should always install the correct baseband version for the Android version you’re running. If you absolutely can not install the correct baseband version you can do the following using the version of fastboot from the AOSP source tree;

    1. From the top of the source tree go to out/target/product/passion/

    2. Run “fastboot flash system system.img”

    3. Then run “fastboot flash boot boot.img”

    4. Then run “fastboot flash recovery recovery.img”

    5. Then run “fastboot flash userdata userdata.img”

    6. Then run “fastboot reboot”