简体   繁体   中英

Execute Script on Boot Android Things

I am developing with raspberry pi3 on Android Things. I am trying to execute a Script on boot, modifying init.rc file as so:

sys.boot_completed = 1:

on property: sys.boot_completed = 1

bootchart stop

# WLD 201805031702

chmod +x /system/bin/myScript.sh //Added by me

sh /system/bin/myScript.sh      //Added by me

I don't know why, but the Script doesn't get execute, i have tried to change "hostname anyName" instead of executing the Script on these lines of init.rc file, and it does pass throw these lines because hostname get changes, but it doesn't execute the Script. How can i execute a Script on Boot, i don't know what to do.

Best regards

Alvaro

With Android Things, you can set up your application so that it fits within the Android framework.

For example, if you use the HOME intent filter on your main activity in your app, then your activity will launch immediately on boot, allowing you to run some code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM