Fix file in system.img for use with android emulator

I need to fix the file in the system.img file used by the Android emulator, in particular, I want to add the ARM binary to the / system / bin directory.

I have this binary compiled beforehand, and it works fine in my emulator, but I can't just remount system.img because rw and adb click it because the change is not permanent on reboots. I tried this on a copy of system.img and passed it to an emulator with an -system, but that was unstable unfortunately.

In an ideal world, I want to modify the "make sdk" process so that the sdk build process automatically includes my binary when creating system.img. It can be done?

If this is not possible, can it be manually inserted into the image?

Many thanks.

+3
source share
2 answers

I was interested in the constant modification of / system folder and tried to unzip the system.img file, which went fine, but I could not create a new img that the emulator was satisfied with (using the mkyaffs2 and unyaffs2 tools to extract and create a new system.img).

Instead, I found a much simpler solution:

  • Delete everything from the / data / directory (except for the lost + found)
  • Copy the contents of / system to the / data li> folder
  • Make the necessary changes to / data /
  • Kill emulator

Now you move your ~ / .android / avd / MYANDROID.avd / userdata-qemu.img file to ~ / system.img (or anywhere else) and run your emulator using the new system image:

emulator -debug all -show-kernel -verbose -avd MYANDROID -no-boot-anim \
-gpu on -partition-size 800 -system [path to your new system.img]

/data userdata-qemu.img. , . ( ). /system folder, , system.img.

+3

system.img , , , logcat, ADB, .

0

Source: https://habr.com/ru/post/1789566/


All Articles