So, I have a custom AOSP image that I'm building, and it allows me to provide my own kernel and debugging features that I want (this is just for the record, because you can't do some things that are needed with a regular AVD). I need to change the contents of /vendor, and I thought that I could do this by providing my .img file to the emulator with:

emulator -vendor /path/to/my/vendor.img

But, as I checked, the md5sum does not match for some files between my vendor.img and in the /vendor/path/to/file when I run the emulator and connect with adb shell. This is perplexing to me, because when I run with -verbose, I can see the arguments given to qemu for the drive and I expect that img to be mounted under /vendor. Looking at the original vendor-qemu.img with 7z, I can check the md5sum of ome files and see that despite the -vendor argument, the sums did not change to the values in my img, but match the old intead. I even went to the length of renaming the original vendor-qemu.img and putting my img in it's place with the name vendor-qemu.img. Same result with the md5sums though.

Perhaps I could be wrong, and the -vendor emulator argument shouldn't change the contents of /vendor in the running emulator instance. What do I do to get the /vendor directory contents of a running emulator instance to match with the vendor.img?

  • /vendor should be the path that the vendor.img is mounted to, if I understand correctly. So, if I change the vendor.img, then that should change the contents of /vendor, but it doesn't. Commented Nov 5, 2021 at 16:30
  • I don't know what FEC would have to do with this. I thought that qemu sees the .img files as drives, android mounts them to directories Commented Nov 5, 2021 at 17:02
  • No. I did not know that it did that. I was wondering if I could rebuild the vendor.img by adding or editing files in the out/target/product/generic_x86_64/vendor and just calling make. Commented Nov 5, 2021 at 20:56
  • Does this answer your question? How to change vendor.img contents with android emulator?
    – alecxs
    Commented Nov 5, 2021 at 21:12
  • just realized you already posted on stackoverflow. I completely misunderstood the question. issue is not with modifications in first place. You ask about how to load modified vendor.img - probably only on reboot. That's how it works on mobile phone, android partitions are loaded ro on boot and dm-verity prevents modifications during runtime. Don't know what running emulator instance is, but I doubt it's possible to replace disk during runtime
    – alecxs
    Commented Nov 5, 2021 at 21:20

1 Answer 1


The way I found to do it was to go to:

out/target/product/<lunch tgt>/vendor/

And just put the vendor contents the way you wish them to be. When finished do:

make vendorimage && make systemimage

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .