Editing Android device init.rc file

Skip to first unread message


Oct 8, 2021, 12:24:45 AM10/8/21
to Android Building

Hi, I am a newbie in embedded Linux, I am able to toggle a gpio pin, as well as initialize an i2c module on an android running device. I used adb shell to access the device shell, and manage to initialise this module manually, I want this to happen at startup/boot up, however, I cant edit the init.rc for my android device since there is no Vim or nano editor, or gedit to open the file so that I can add a new file to be executed at startup.


I manage to push a bash file to the android device using adb push, but I can only run it manually eg: ./file.sh inside the device.


I am thinking of building the adroid files and include the file that I want to use to initialize the i2c device, but I don't know how to achieve this. 


Any help would be appreciated.

Abhayadev S

Oct 8, 2021, 5:38:07 PM10/8/21
to Android Building

I think what you are trying to achieve is an init script. for that you need to have root level permissions.
do you have access to the source of the device?

you can listen for system properties as triggeres for your script to run.
Reply all
Reply to author
0 new messages