Modify the system partition of the Android emulator and join Supersu

Source: Internet
Author: User

http://www.claudxiao.net/2013/10/persistent-change-emulator-system-partition/

For Android emulator, if you want to modify the files in its system partition, you need to persist the data in addition to the remount- Because emulator will load system.img as read-only by default, even changes to it after remount are not actually saved.

A variety of solutions to this persistence problem are mentioned on the network. For example [1], copy the/system to the emptied/data partition, then rename the corresponding userdata-qemu.img to System.img, and [2] to live/system, dump it into an image file via the Yaffs tool. These methods are more complex, and the following is an easy way to do this, from [3].

1. Create an AVD, in this example, we use Android 4.2.2, named Root.

2. Copy the system.img file of the system under the SDK to the next copy of the AVD directory, for example, here:

$ cp adt-bundle-mac/sdk/system-images/android-17/armeabi-v7a/system.img ~/.android/avd/root.avd/

3. Manually specify the mount parameter to start it:

$ emulator -avd root -qemu -nand system,size=0x1f400000,file=~/.android/avd/root.avd/system.img

Among them, 0x1f400000 refers to the/system partition 500MB space.

4. After the system starts, the ADB remount, then through the ADB mount you can see that the system partition has become RW.

5. You can now make the desired changes to the/system partition.

6. When the modification is complete, turn off the simulator. After the normal boot can:

$ emulator -avd root

Then if you want to make changes to the system, repeat the 第3-6 step.

Well, as you can see from the name of the AVD, I want to add a root in it. The method is:

1. Download the Chainfire supersu Update zip package [4] and unzip it.

2. In the 5th step above, execute the following command:

$ adb push arm/su /system/xbin/

$ adb chmod 06755 /system

$ adb chmod 06755 /system/xbin/su

$ adb install common/Superuser.apk

3. In the simulator, enter the Supersu, you will be prompted to update the binary files, select the general method.

Reference links

[1] http://allencch.wordpress.com/2012/02/29/learn-to-root-android-using-emulator/

[2] Http://blog.thecobraden.com/2012/06/making-persistent-changes-to-android.html

[3] Http://stackoverflow.com/questions/15417105/forcing-the-android-emulator-to-store-changes-to-system

[4] Http://download.chainfire.eu/supersu

Modify the system partition of the Android emulator and join Supersu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.