android系统开发修改桌面Launcher3代码编译安装验证
1.使用aidegen打开Launcher3项目
- 1.1 首先整个aosp源代码编译成功过,自然也就是编译成功了
aidegen
工具。Android10之后才有aidegen工具,之前还只是idegen工具相对难用点。 - 1.2 先cd来到源代码根目录下:
cd ~/aosp_10.0.0_r17
- 1.3 导入编译环境:
source build/envsetup.sh
- 1.4 选择编译目标:
lunch aosp_sailfish-userdebug
- 1.5 首次打开Launcher3项目:
aidegen packages/apps/Launcher3 -i s -p ~/Downloads/android-studio-2022.2.1.20-linux/android-studio/bin/
-i s
表示使用Android Studio
打开,-i c
表示使用Clion
打开,这个是用于c/cpp开发工具,-p 路径
表示指定Android Studio的安装路径
会提示:INFO: If you are sure the related modules and dependencies have been already built, please try to use commandaidegen packages/apps/Launcher3 -s
to skip the building process.
下次打开可以添加 -s 参数,表示skip忽略编译过程,因为首次打开已经编译过依赖了,下次打开就不用再费时间重新编译依赖了。
忽略编译打开项目命令:aidegen packages/apps/Launcher3 -s -i s -p ~/Downloads/android-studio-2022.2.1.20-linux/android-studio/bin/
2. 修改Launcher3项目源代码,这里以隐藏Google搜索栏为例
- 2.1 Android Studio打开项目之后,开发就和平时开发区别不大了,能搜索和跳转类、变量使用等等
- 2.2 修改代码如下截图,注掉掉qsb添加进来的代码即可
3. 独单编译Launcher3项目
- 3.1 编译Launcher3项目:
mmm packages/apps/Launcher3/:Launcher3QuickStep
使用
:Launcher3QuickStep
指定编译的是Launcher3QuickStep模块,Launcher3项目包含了Home Launcher2 Launcher3 Launcher3QuickStep
执行模块,我们使用的Launcher3QuickStep
模块
- 3.2 编译成功输出结果:
[100% 401/401] Install: out/target/product/sailfish/system/product/priv-app/Launcher3QuickStep
4. 独单安装Launcher3验证
- 验证修改结果:
adb install -r out/target/product/sailfish/system/product/priv-app/Launcher3QuickStep/Launcher3QuickStep.apk
adb install -r
表示替换安装该安装包
- 或者使用第二种验证方法,比较麻烦一点:
adb push out/target/product/sailfish/system/product/priv-app/Launcher3QuickStep/Launcher3QuickStep.apk system/system_ext/priv-app/Launcher3QuickStep/
然后adb reboot
重启设备
如果执行adb push失败,需要remount一下system区:
adb root、adb remount、adb disable-verity、adb reboot、adb root、adb remount
5. 整机编译验证
- 5.1 导入编译环境:
source build/envsetup.sh
- 5.2 选择编译目标:
lunch aosp_sailfish-userdebug
- 5.3 执行make编译:
make -j4
- 5.4 最好就是刷机:
fastboot flashall -w
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
2022-06-13 Android开发java.lang.Class里面的native方法实现类源代码-记录一下备用
2022-06-13 Android开发IDEA开发工具出现错误: 找不到或无法加载主类
2018-06-13 Android使用webp格式图片的步骤
2018-06-13 Uri.parse读取raw资源