Android framework调试和AMS等服务调试

make framework # Android11开始,建议使用命令:make framework-minus-apex

编译成功后,framework.jar会生成到:out/target/product/产品代号/system/framework中。

make services

编译/frameworks/base/services目录下的代码,详见/frameworks/base/services/Android.bp中的定义

复制代码
// merge all required services into one jar
// ============================================================
java_library {
    name: "services",
    defaults: ["services_java_defaults"],
    installable: true,

    dex_preopt: {
        app_image: true,
        profile: "art-profile",
    },

    srcs: [":services-main-sources"],

    // The convention is to name each service module 'services.$(module_name)'
    static_libs: [
        "services.core",
        "services.accessibility",
        "services.appprediction",
        "services.appwidget",
        "services.autofill",
        "services.backup",
        "services.companion",
        "services.contentcapture",
        "services.contentsuggestions",
        "services.coverage",
        "services.devicepolicy",
        "services.midi",
        "services.musicsearch",
        "services.net",
        "services.people",
        "services.print",
        "services.profcollect",
        "services.restrictions",
        "services.searchui",
        "services.smartspace",
        "services.speech",
        "services.systemcaptions",
        "services.translation",
        "services.texttospeech",
        "services.usage",
        "services.usb",
        "services.voiceinteraction",
        "services.wallpapereffectsgeneration",
        "services.wifi",
        "service-blobstore",
        "service-jobscheduler",
        "android.hidl.base-V1.0-java",
    ],

    libs: [
        "android.hidl.manager-V1.0-java",
        "framework-tethering.stubs.module_lib",
        "service-art.stubs.system_server",
    ],

    // Uncomment to enable output of certain warnings (deprecated, unchecked)
    //javacflags: ["-Xlint"],
}

其中的services.core就包含了/frameworks/base/services/core目录下的内容,例如ActivityManagerService

产物services.jar和framework.jar一样,在/system/framework/目录下,所以调试AMS的时候,make framework是不行的。虽然这样会校验/frameworks/base/services/core目录下的语法错误,但是不会编译services.jar

相关推荐
SharpCJ26 分钟前
Android 开发者为什么必须掌握 AI 能力?端侧视角下的技术变革
android·ai·aigc
_李小白1 小时前
【OSG学习笔记】Day 38: TextureVisitor(纹理访问器)
android·笔记·学习
JJay.1 小时前
Kotlin 高阶函数学习指南
android·开发语言·kotlin
jinanwuhuaguo1 小时前
截止到4月8日,OpenClaw 2026年4月更新深度解读剖析:从“能力回归”到“信任内建”的范式跃迁
android·开发语言·人工智能·深度学习·kotlin
JJay.2 小时前
Android Kotlin 协程使用指南
android·开发语言·kotlin
BLUcoding3 小时前
Android 布局介绍
android
summerkissyou19873 小时前
android-蓝牙-状态和协议值总结及监听例子
android·蓝牙
徒 花3 小时前
数据库知识复习05
android·数据库
提子拌饭1335 小时前
番茄时间管理:鸿蒙Flutter 实现的高效时间管理工具
android·flutter·华为·架构·开源·harmonyos·鸿蒙
4311媒体网5 小时前
帝国CMS二次开发实战:精准实现“最新资讯”标识与高亮判断
android