入职小白随笔之高通项目编译流程

入职小白随笔之高通项目编译流程,第1张

概述声明:本文来自我的导师wangjie.  本文主要包含以下内容一、查看项目所在分支二、切换到目标分支三、查看当前所在分支四、编译Android源码五、sourceAndroid编译环境六、lunch所需的编译项目七、单编模块八、push模块验证修改是否生效一、查看项目所在分支gitbra

声明:本文来自我的导师wangjIE.

 

 

本文主要包含以下内容

一、查看项目所在分支
二、切换到目标分支
三、查看当前所在分支
四、编译AndroID源码
五、source AndroID 编译环境
六、lunch 所需的编译项目
七、单编 模块
八、push 模块 验证修改是否生效

一、查看项目所在分支

git branch -a
表示:查看并列出当前项目所有分支

高通项目举例如下:

wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ git branch -a* linux_androID_development  master  remotes/origin/A/B_update_linux_androID_development  remotes/origin/head -> origin/master  ... ...  remotes/origin/secure_linux_androID_development  remotes/origin/streamlined_code_engineeringwangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ 
二、切换到目标分支

git checkout 分支名
表示: 切换到某个分支。

高通项目举例如下:
git checkout linux_androID_development

wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ git branch -a* linux_androID_development  master  remotes/origin/A/B_update_linux_androID_development  remotes/origin/head -> origin/master  remotes/origin/cts_development_branch  ... ...wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ git checkout linux_androID_development 
三、查看当前所在分支

git branch
表示:查看当前所在分支

高通项目举例如下:

wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ git branch * linux_androID_development  masterwangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ 
四、编译AndroID源码

AndroID 源码编译,每个项目由于脚本各不相同,编译的命令 有时候也会有说差异。

Google 官方编译命令如下

1.source ./build/envsetup.sh
2.lunch 项目
3.make -j8

高通项目编译命令 如下:

./buildall_userdeBUG.sh E5527M all

五、source AndroID 编译环境

首先进入AndroID 源码根目录,执行source ./build/envsetup.sh,
如不source,后续则无法单编模块。

高通项目举例如下:

wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ source ./build/envsetup.sh including device/generic/car/vendorsetup.shincluding device/generic/mini-emulator-arm64/vendorsetup.shincluding device/generic/mini-emulator-armv7-a-neon/vendorsetup.shincluding device/generic/mini-emulator-x86_64/vendorsetup.shincluding device/generic/mini-emulator-x86/vendorsetup.shincluding device/generic/uml/vendorsetup.shincluding device/Google/muskIE/vendorsetup.shincluding device/Google/taimen/vendorsetup.shincluding device/qcom/common/vendorsetup.shincluding device/qcom/qssi/vendorsetup.shincluding vendor/partner_gms/products/vendorsetup.shincluding vendor/qcom/opensource/core-utils/vendorsetup.shincluding vendor/qcom/proprIEtary/common/vendorsetup.shincluding vendor/qcom/proprIEtary/prebuilt_HY11/vendorsetup.shCreated 9 symlinks out of 9 mapped links..including sdk/bash_completion/adb.bashwangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ 
六、lunch 所需的编译项目

执行 lunch 命令,查看所有 编译项目列表,然后选择 编译项目。
高通项目 举例如下:

1. lunch ,然后选择所需编译分支
wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ lunchYou're building on linuxLunch menu... pick a combo:     1. aosp_arm-eng     2. aosp_arm64-eng     3. aosp_mips-eng     ... ...     40. msm8937_64-userdeBUG     41. msm8937_64-user     ... ...     65. taimenb2-userdeBUG// 选择要编译的分支名Which would you like? [aosp_arm-eng] msm8937_64-userdeBUGdevice/qcom/msm8937_64/msm8937_64.mk:42: warning: "Build with 4.9 kernel" ... ...OUT_DIR=out============================================wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ 
2. 直接lunch 分支

比如我们需要编译msm8937_64-userdeBUG项目,其实我们可以执行最简单的方法,直接lunch这个项目所排列的位置,比如lunch 40

wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ lunch 40device/qcom/msm8937_64/msm8937_64.mk:42: warning: "Build with 4.9 kernel"============================================PLATFORM_VERSION_CODEname=RELPLATFORM_VERSION=9TARGET_PRODUCT=msm8937_64... ...HOST_CROSS_2ND_ARCH=x86_64HOST_BUILD_TYPE=releaseBUILD_ID=PKQ1.190601.001OUT_DIR=out============================================wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ 
七、单编 模块

我们常用 mmm 以及mm 来及对单模块进行编译。
mmm 与mm 主要区别在于你当前所在的目录位置。
如果当前正在所要编译模块的地方(需要有androID.mk文件,才可以进行),请使用 mm,否则使用mmm

高通项目举例如下:

1. mmm使用举例(此时不在FM 目录)

比如单编FM,不在FM目录下,需要执行mmm vendor/qcom/opensource/commonsys/fm/fmapp2/

wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ mmm vendor/qcom/opensource/commonsys/fm/fmapp2//wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID/vendor/qcom/opensource/commonsys/fm/fmapp2/Restriction Checker not present, skipPing..device/qcom/msm8937_64/msm8937_64.mk:42: warning: "Build with 4.9 kernel"============================================... ...OUT_DIR=out============================================QSSI: not enabled for msm8937_64 target as vendor/qcom/proprIEtary/release/QSSI/QSSI_enforced_targets_List.txt was not found.... ...#### build completed successfully (7 seconds) ####wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ 
2. mm使用举例(在FM 目录下)

比如单编FM,在FM目录下,需要执行mm

wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID$ cd  vendor/qcom/opensource/commonsys/fm/fmapp2/wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID/vendor/qcom/opensource/commonsys/fm/fmapp2$ mmRestriction Checker not present, skipPing..device/qcom/msm8937_64/msm8937_64.mk:42: warning: "Build with 4.9 kernel"============================================PLATFORM_VERSION_CODEname=RELPLATFORM_VERSION=9... ...OUT_DIR=out============================================QSSI: not enabled for msm8937_64 target as vendor/qcom/proprIEtary/release/QSSI/QSSI_enforced_targets_List.txt was not found.ninja: no work to do.... ...build/make/core/base_rules.mk:412: warning: ignoring old commands for target `out/target/product/msm8937_64/vendor/lib64/hw/fingerprint.default.so'ninja: no work to do.#### build completed successfully (41 seconds) ####wangjIE@wangjIE:/wangjIE/Qualcomm_p/E5527M_MSM8917_QM215_r26/LA.UM.7.6.2/liNUX/androID/vendor/qcom/opensource/commonsys/fm/fmapp2$ 
八、 push 模块 验证修改是否生效1. 使用deBUG版本,挂载手机

adb shell getprop ro.build.type 主要用来查看当前使用的版本,调试只能使用deBUG 版本,user版本无法调试。

高通项目举例如下:

C:\Users\administrator>adb shell getprop ro.build.typeuserdeBUGC:\Users\administrator>adb rootC:\Users\administrator>adb remountremount succeededC:\Users\administrator>
2.将生成的单模块编译的apk 拷贝到桌面并push到手机中

adb push 本地文件 手机目录
adb push主要用来 替换手机中的apk,调试验证单编是否生效。

高通 FM 举例如下:

C:\Users\administrator>adb push C:\Users\administrator\Desktop\FM2.apk /system/app/FM2C:\Users\administrator\Desktop\FM2.apk: 1 file pushed. 9.7 MB/s (861880 bytes in 0.085s)C:\Users\administrator>
3. 清除 push apk 的存储数据

adb shell pm clear 包名
用来清除当前包名的数据。
比如:adb shell pm clear com.caf.fmradio

高通 FM apk举例如下:

C:\Users\administrator>adb shell dumpsys activity | findstr Run    Running activitIEs (most recent first):        Run #0: ActivityRecord{3bc8d7d u0 com.caf.fmradio/.FMRadio t52}    Running activitIEs (most recent first):        Run #0: ActivityRecord{89df584 u0 com.androID.launcher3/com.androID.searchlauncher.SearchLauncher t51}C:\Users\administrator>adb shell pm clear com.caf.fmradioSuccessC:\Users\administrator>
 

 

总结

以上是内存溢出为你收集整理的入职小白随笔高通项目编译流程全部内容,希望文章能够帮你解决入职小白随笔之高通项目编译流程所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1111528.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存