I was trying to modify the android emulator system.img file. I want to start android emulators from the modified system.img.
I tried the https://github.com/anestisb/android-simg2img approach, with error "Invalid sparse file format at header magi"
The exact file is "Android/Sdk/system-images/android-26/google_apis/x86/system.img", its an official google img downloaded from sdkmanager.
$ file /home/user/Android/Sdk/system-images/android-26/google_apis/x86/system.img
./system.img: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x146,155,21), startsector 1, 5246975 sectors, extended partition table (last)
$ fdisk -lu /home/user/Android/Sdk/system-images/android-26/google_apis/x86/system.img
Disk /home/user/Android/Sdk/system-images/android-26/google_apis/x86/system.img: 2.5 GiB, 2686451712 bytes, 5246976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9C0C82F8-6E6F-46F9-AFC8-A09D908DAB24
Device Start End Sectors Size Type
/home/huya/tmp/system.img1 2048 5244927 5242880 2.5G Linux filesystem
How to add some files to this .img file and start an emulator from it? Basically I want to run a customized emulator with some file modified, any other approaches are welcomed.