Building Android AOSP for board hikey960
Building AOSP
This instruction will show you how to build AOSP for the Hikey960.
Steps to Fetch AOSP Source:
mkdir /home/$USER/aosp
repo init -u https://android.googlesource.com/platform/manifest -b master
sudo cp /home/$USER/aosp/.repo/repo/repo /usr/bin/repo
repo sync -j`nproc`
Set up your build environment
source build/envsetup.sh
Fetch hikey960 vendor package
./device/linaro/hikey/fetch-vendor-package.sh
Target Selection for Build: hikey960
The following example uses the current AOSP from the master branch for device hikey960. You can select the build variant as follows:
- user: for production builds
- userdebug: for development builds
- eng: for development builds with faster build times
lunch hikey960-aosp_current-userdebug
You can enable hardware AddressSanitizer (ASAN) for memory error detection.
export SANITIZE_TARGET=hwaddress
Build AOSP: Start the build process:
m -j`nproc`
Flashing all images to the device:
-
Ensure the Device is in Fastboot Mode: Make sure the board is powered on with Switch 1 and Switch 3 set to ON.
-
Connect the Device: Connect the device to your computer via USB.
-
Open a Terminal: On your host machine, open a terminal window.
-
Verify Fastboot Connection: Run the following command to check if the device is recognised:
fastboot devices
Flash the images:
sudo ./device/linaro/hikey/installer/hikey960/flash-all.sh
Switching to Normal Mode and Connecting via ADB:
-
Turn off the device.
-
Change Jumper Switch: Set Switch 1 to the ON position and ensure Switch 2 and Switch 3 are set to OFF. This will put the board into normal mode.
-
Wait for the Board to Start: Allow some time for the board to fully boot up.
-
Connect to the Device: Once the board has started, open a terminal on your computer.
-
Execute ADB Shell: Run the following command to connect to the device:
adb shell
Installation is Ready: You can now proceed with your setup or configuration as needed.