Android源码下载&编译(高通)

0 前言

    本文介绍如何下载高通平台的Android源码,然后进行编译。

    相关:《Android源码下载&编译(TI)

1 安装工具

    下载Android源码需要git,repo等工具,启动repo是Google写的一个专门用于下载Android源码的工具,主要调用了git。

(1)安装git

sudo apt-get install git

(2)安装repo

    repo是Google写的一个Python脚本,用于管理多个git仓库,专用于Android源码下载。

    下载repo,改变可执行权限,然后移动到/usr/bin目录中即可:

chomd +x repo
sudo mv repo /usr/bin

2 下载Android

    由于Google被墙了,因此无法直接从Google官网下载Android源码,因此需要另觅途径,高通开源网是一个不错的选择。本文在其中下载支持高通msm8909平台的Android源码,Android版本为6.0.1,详细步骤如下:

mkdir android-msm8909
cd android-msn8909
repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.BR.1.2.6.c1-02100-8x09.0.xml
repo sync -j4

    a)源码大小有40GB,下载过程要几个小时;

    b)上述LA.BR.1.2.6.c1-02100-8x09.0.xml在高通开源网上查看:

3 编译Android

3.1 安装JDK

    通过《Android源码编译--jdk版本查询》的方法查看上述源码所需的JDK版本,得知需要安装OpenJDK-1.7:

sudo apt-get install openjdk-7-jdk

3.2 编译

1)进入android-msm8909目录:

cd android-msm8909
source build/envsetup.sh
lunch 27
make -j4
# or
make -j4 showcommands dist

  • -j4, 开启4个线程;
  • showcommands, 显示编译过程中执行的命令[38];
  • dist, 将编译后产生的发布文件拷贝到out/dist目录中[38];
  • lunch不加参数时,将会列出可选产品,本文选择27

3.3 编译结果

    编译完成后,生产的相关镜像在out/target/product的子目录中,例如:

    其中,linux内核编译结果保存在obj/KERNEL_OBJ目录中(Linux内核也一同被编译了,而无需另外独立编译!)。

4 编译sdk

    详见《Android源码编译SDK》。

5 编译内核

make bootimage

6 编译其它模块

    参考资料[37]总结了编译各个模块的方法:

make sdk - build the tools that are part of an SDK (adb, fastboot, etc.)
make snod - build the system image from the current software binaries
make services
make runtime
make droid - make droid is the normal build.
make all - make everything, whether it is included in the product definition or not
make clean - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/
make modules - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)
make <local_module> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)
make clean-<local_module> - clean a specific module
make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage - create a new boot image with custom bzImage

参考资料

[1]Ubuntu 下载 & 编译 Android5.1 源码

[2]国内镜像加速Android源码下载

[3]在Ubuntu系统中下载Android源码(5.1.1_r8)

[4]ubuntu repo准备和代码下载

[5]android系统源码下载

[6]下载android4.4.2源码全过程(附已下载的源码)

[7]android 4.4源码下载——百度云盘地址

[8]基于Ubuntu 14.04 LTS编译Android4.4.2源代码

[9]Qualcomm平台android开发总结

[10]高通android平台源码 (2011-03-28 10:56)

[11]在官网途径无法下载到android 源码时,,你可通过这种方式去下载

[12]高通平台android开发总结(7630)

[13]Android for MSM Project
[14]Qualcomm平台android开发总结

[15]高通平台android开发总结 MSM平台上的AMSS

[16] android源码下载(上)

[17]android源码下载(下)

[18]开源代码下载路径

[19]如何下载并编译Android4.0内核源码goldfish(图文)

[20]Android源码、内核编译

[21]如何下载Android kernel内核源代码,编译烧写验证

[22]编译Android系统源码和内核源码

[23]Android源码编译的全过程记录

[24]在Ubuntu 14.04系统中编译Android 5.1.1源码

[25]Android AOSP 5.1.0 & 5.0.1源代码百度云下载

[26]Android 6.0 源代码编译实践

[27]自己动手编译Android源码(超详细)

[28]Android学习系列(38)--Android源码下载和编译

[29]Android SDK 源代码编译

[30]编译时候 make和 make sdk有什么区别?

[31]android 如何制作自己的sdk

[32]Android 源码编译 make sdk ADT

[33]android编译SDK问题汇总

[34]如何在linux下编译windows版android sdk

[35]ubuntu12.04(64bit)编译android4.2.2源代码及SDK步骤

[36]Android_SDK编译,带自己api的android.jar编译

[37]Android Build System

[38]Android源代码编译命令m/mm/mmm/make分析

  • 5
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

OneSea

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值