framework修改快速验证

一. 背景

framework层代码调试时,需要快速编译,因此有必要了解不同目录源码生成的目标文件。

二. frameworks/base/services

如:

frameworks/base/services/core/java/com/android/server/BatteryService.java

编译:

make -j45 services

输出:

out/target/product/monaco_go/system/framework/oat/arm/services.odex

out/target/product/monaco_go/system/framework/oat/arm/services.vdex

out/target/product/monaco_go/system/framework/oat/arm/services.art

out/target/product/monaco_go/system/framework/services.jar.prof

out/target/product/monaco_go/system/framework/services.jar

运行:

out/target/product/monaco_go/system/framework/oat/arm/services.odex

out/target/product/monaco_go/system/framework/oat/arm/services.vdex

out/target/product/monaco_go/system/framework/oat/arm/services.art

out/target/product/monaco_go/system/framework/services.jar.prof

out/target/product/monaco_go/system/framework/services.jar

验证:如下代码保存.bat

复制代码
echo off 
adb wait-for-device
adb root 
adb remount
set dir=%~dp0

adb push %dir%services.jar system/framework/services.jar
adb push %dir%services.jar.prof system/framework/services.jar.prof
adb push %dir%services.art system/framework/oat/arm/services.art
adb push %dir%services.vdex system/framework/oat/arm/services.vdex
adb push %dir%services.odex system/framework/oat/arm/services.odex
adb shell sync
 
)
pause

三. frameworks/base/

编译:

make -j12 framework

输出:

out/target/product/monaco_go/system/framework/framework.jar

运行:

system/framework/framework.jar

验证:如下代码保存.bat

复制代码
echo off 
adb wait-for-device
adb root 
adb remount
set dir=%~dp0

adb push %dir%framework.jar system/framework/framework.jar
adb shell sync
 
)
pause

参考:

android单独编译framework模块 - 轻轻的吻 - 博客园

相关推荐
GitLqr1 天前
Flutter 无障碍开发实战:玩转 Semantics 解决视障用户使用痛点
android·flutter·dart
雨白1 天前
掌握 NestedScrolling 嵌套滑动:手写仿知乎折叠主页
android
Xzaveir1 天前
别把所有“认证”都塞进 AuthService:实名、一键登录与号码身份的领域拆分
android·人工智能
BerrySen1781 天前
KMP全栈开发:从Android到AI Agent的技术演进与实践
android·人工智能
AFinalStone1 天前
Android 7系统休眠唤醒(一)电源管理架构全景图
android·powermanager·电源管理
YM52e2 天前
鸿蒙Flutter Center居中组件:Align对齐详解
android·学习·flutter·华为·harmonyos·鸿蒙
时间的拾荒人2 天前
MySQL 视图详解
android·数据库·mysql
祉猷并茂,雯华若锦2 天前
Appium 3.x安卓按键与通知栏操作全指南
android·appium
码农coding2 天前
android 12 SurfaceFlinger开机启动分析
android
hunterandroid2 天前
Paging 3 RemoteMediator 实战:构建离线优先的分页列表
android·前端