android开源代码编译方法

编译android开源代码之前,确保要下载完整的android源码
具体下载方法见链接:国内android源码下载镜像及下载方法

代码下载完后,安装步骤很简单:
1. 配置envsetup.sh权限
ylp@ubuntu:~/bin/build$ chmod 755 envsetup.sh

2.执行脚本
ylp@ubuntu:~/bin$ . build/envsetup.sh —点和build之间有空格
including device/asus/fugu/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips64/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/google/dragon/vendorsetup.sh
including device/htc/flounder/vendorsetup.sh
including device/huawei/angler/vendorsetup.sh
including device/lge/bullhead/vendorsetup.sh
including device/linaro/hikey/vendorsetup.sh
including device/moto/shamu/vendorsetup.sh
including sdk/bash_completion/adb.bash

3.编译
ylp@ubuntu:~/bin$ make -j2 (其中j2代表用的单核CPU,可以最大运行cpu个数*2+1个线程,一般2核系统,取值为make -j4; 4核系统取值为make -j8)

你可能感兴趣的:(android源码编译)