简体   繁体   English

重新启动时重新生成init.rc文件

[英]The init.rc file regenerated on restart

I have added some script to start my application in init.rc file. 我在init.rc文件中添加了一些脚本来启动我的应用程序。 But when I restart the emulator the file gets changed to its original file. 但是,当我重新启动模拟器时,该文件将更改为原始文件。 I want that the changes made by me should not be removed on start-up. 我希望在启动时不要删除我所做的更改。

Thanks in advance. 提前致谢。

The init.rc file is part of the ramdisk.img you will need to unpack the ramdisk.img file in the avd make any modifications are repack it. init.rc文件是ramdisk.img的一部分,您需要将其在avd中解压缩ramdisk.img文件,以便进行任何修改并将其重新打包。

On linux it can be unpacked with the following commands 在Linux上,可以使用以下命令将其解压缩

mkdir ramdisk && cd ramdisk
gunzip -c ../ramdisk.img | cpio -i 

modify the init.rc as you please and then repack it with 根据需要修改init.rc,然后重新打包

find . | cpio -o -H newc | gzip > ../new_ramdisk.img

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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