I'm accustomed to running scripts on boot in Linux, but I'm not sure how to do this in Android. I'd like to start my SSH daemon on start, so I'll always be able to connect. How can I run an arbitrary script on Android boot? It'd be preferable to do this outside of Dalvik.
While looking around my Android filesystem, I found that it did, in fact have a
This being, of course, exactly what I needed, I wrote the following script on my computer then pushed it to my device:
(pushed to device via
Rebooted the device, then ran
Edit: Apparently you might need to shoehorn the edited script into the boot image as well. Info on how to do that here: http://forum.xda-developers.com/showthread.php?t=443994
Some above steps may be replaces with:
and later remount RO:
Now your task to find executable or
Google about each candidate to get know how this file was used.
Good candidate for including custom scripts are lines from:
As each device unique you may need to do own guess about search criteria...
For example I found
See also hard way (if you have no luck with finding magic file): http://stackoverflow.com/questions/9768103/make-persistent-changes-to-init-rc