3

I am trying to fallow this tutorial in order to install SSL certificate on Android emulator.

I need to start the emulator from command line, so I run

emulator -avd myDevice -http-proxy myIp:8888

After device is started I want to copy my certificate file from PC to the device, so I run those commands

  • mount -o remount,rw /system
  • cp /sdcard/5ed36f99.0 /system/etc/security/cacerts/
  • cd /system/etc/security/cacerts/
  • chmod 644 5ed36f99.0

I bundle them all together using this suggestion

The final command looks like this:

adb shell su -c 'mount -o remount,rw /system; cp /sdcard/5ed36f99.0 /system/etc/security/cacerts/; cd /system/etc/security/cacerts/; chmod 644 5ed36f99.0'

But I am getting an error:

su: invalid uid/gid '-c'

If I do it from the shell it works, but then when I restart the emulator it restore the system to previous state without saving my changes.

How can I solve those two problems?

Community
  • 1
  • 1
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
  • Have you checked [here](https://android.googlesource.com/platform/system/extras/+/master/su/su.c).? I think in android `SU` command is not as same as the Linux one. – Madhukar Hebbar May 30 '16 at 13:33
  • @MadhukarHebbar I try, tnx. My bigger problem is that all the data is gone when emulator is rebooted – Ilya Gazman May 30 '16 at 14:23

0 Answers0