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

相关推荐
雨白15 小时前
单例设计模式:从 Java/Kotlin 实现到 Android 实战
android
hai_android19 小时前
一行 asLiveData,背后是一座生命周期的桥
android·java·kotlin
阿杰m20 小时前
Android源码第二十三章:Telephony、RIL 与 IMS——来电怎么到应用?
android
booboosui20 小时前
没人认领 .md:安卓把报告交给了音乐播放器打开
android
用户60709759149061 天前
AOSP 14 OTA 升级指导(四):update_engine 内部机制——Action 流水线与写盘
android
恋猫de小郭1 天前
Jetpack Compose 1.13 发布,憋了这么久终有交代了
android·前端·flutter
JMchen1231 天前
【Android 性能优化实战 60 讲】12 异步 Inflate 实战与痛击:源码拆解原生瓶颈,手写增强版布局预加载框架
android·性能优化·实战·启动优化·异步inflate·x2c
好的佩奇2 天前
蓝牙之设备角色与连接
android·flutter·蓝牙
雨白2 天前
Android 消息机制剖析:从 Handler 投递到 Looper 循环的全链路
android
GY-932 天前
【Android】数据分层和依赖注入
android