Install OpenGApps in Android Studio Emulator (Marshmallow)

I wanted to install OpenGApps in an Android emulator (created in Android Studio). The emulator is running with Marshmallow. There is enough storage space available, so this is not the problem. I tried everything which I found on Google, but it just wont work.

While the emulator is booting up, and I keep spamming adb remount, first it shows remount succeeded, and just after the desktop shows up, it suddenly says remount of /system failed: Read-only file system and remount failed.

So it doesn’t work either when I try to push an OpenGApp .apk using adb push. If I try after booting up, it says: adb: error: failed to copy 'Phonesky.apk' to '/system/priv-app/Phonesky.apk': Read-only file system (or whatever the .apk is).

I can’t remount /system with rw either: When I make the following:

$   adb shell > *some remount command* 

Following shows up: mount: Read-only file system. I tried it with various commands (substitute one of them with *some remount command*, the output is always the same):

  • mount -o rw,remount /system
  • mount -o rw,remount /system /system
  • mount -o rw,remount /dev/block/vba /system
  • mount -o rw,remount /dev/block/mtdblock0 /system
  • mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system

I also tried to run su after adb shell, but it had no effect either. I also tried to remount rootfs to / first with rw. This worked without an issue, but the remount for /system gave the same error as without remounting rootfs.

Could anyone help me with this struggle?

Edit 1: I also tried it with various different emulator settings, it didn’t change a thing either. So I guess this problem is not depending on the emulator itself…

Please note: A bounty was offered to resolve this question, but I don’t have much time for this at the moment. I would be grateful if you would ping me on twitter if an answer worked for you, so I can eventually accept it after I have tried it by myself. But this would save me a lot of time. Thanks