最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - How to add a new service in `init.rc` for Lineage OS? - Stack Overflow

programmeradmin1浏览0评论

I am trying to add a new service during bootup. Call it my_service.

So I add a new folder system/core/my_service, which includes Android.bp:

cc_binary {
    name: "my_service",
    srcs: ["my_service.cpp"],
    cflags: ["-Wall"],
    stem: "my_service",
    installable: true,
}

and my_service.cpp.

I also changed the init.rc:

# init.rc
service my_service /system/bin/my_service
    class main
    user root
    group root
    disabled
    oneshot

on boot
    start my_service

Then, I ran mka to build the image.

The problem is, although I can see out/target/product/emu64x/system/bin/my_service after I ran my_service, I cannot find /system/bin/my_service in my emulator.

I would like to ask why and how should I do it correctly?

发布评论

评论列表(0)

  1. 暂无评论