赞
踩
android系统开机自动启动并执行的shell脚本
device/qcom/common/rootdir/etc/目录下#!/system/bin/sh
netcfg eth0 up
system/core/rootdir/init.rc#编写自己要执行的服务
service upbridge /system/bin/upbridge.sh
user root
group root
disabled
#在init.rc中启动该服务
on property:sys.boot_completed=1
start upbridge
#当权限不足时,添加权限
chown root shell /system/bin/upbridge.sh
chmod 0550 /system/bin/upbridge.sh
device/qcom/msm8953_64/msm8953_64.mk PRODUCT_COPY_FILES += \
device/qcom/common/rootdir/etc/upbridge.sh:system/bin/upbridge.sh
Tips:可将脚本拷贝到
system/bin/目录下 ,手动执行脚本,确认脚本无误之后加入到系统里面编译
ps aux | grep "upbridge.sh"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。