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

相关推荐
小书房12 分钟前
Kotlin的by
android·开发语言·kotlin·委托·by
jinanwuhuaguo40 分钟前
(第二十八篇)OpenClaw成本与感知的奇点——从“Token封建制”到“全民养虾”的本体论地基
android·人工智能·kotlin·拓扑学·openclaw
xxjj998a1 小时前
Laravel4.x核心特性全解析
android·mysql·laravel
JoshRen2 小时前
2026教程:在Android Termux中集成Gemini 3镜像站实现移动端文档自动处理与摘要生成(附国内免费方案)
android
诸神黄昏EX3 小时前
Android Google KEY
android
一起搞IT吧3 小时前
Android性能系列专题理论之十一:block IO问题分析思路
android·嵌入式硬件·智能手机·性能优化
小妖6663 小时前
怎么用 tauri 创建编译 android 应用程序
android·tauri
鸟儿不吃草5 小时前
安卓实现左右布局聊天界面
android·开发语言·python
xxjj998a6 小时前
Laravel 1.x:PHP框架的原始魅力
android·php·laravel
formula100006 小时前
在iOS/安卓上远程连接任何 Agent!Claude、Codex、Copilot、Gemini、OpenCode 等
android·copilot