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?