Android模拟器永久删除卸载系统APK(Windows & Linux平台)

蓝色内容表示在Linux平台上的操作。


1.      Goto …….\android-sdk_r08-windows\android-sdk-windows\platforms\android-9\images (this is the default folder for SDK Platform Android 2.3, API 9, revision 1), copy system.img and paste it to C:\Users\Username\.android\avd\Emulator’s name.avd

On Linux,拷贝到/home/users/<User Name>/.android/avd/<Emulator's Name>.avd


2.      Modify hardware-qemu.ini,change:

disk.systemPartition.initPath=C:\Users\Username\.android\avd\Emulator’sname.avd/system.img

disk.systemPartition.initPath=/home/users/<Username>\.android\avd\Emulator’sname.avd/system.img


3.      Type the following: emulator –avd avd-name –partition-size 100 and hit Enter(please replace avd-name with

your emulator’s name). This command will launch youremulator. Please don’t try to launch it from SDK manager, otherwise, it won’twork.

不使用该命令,可能造成在拷贝apk文件到/system/app时,出现Out of memory的错误。   

4.      Launch another command prompt window, switch to …….\android-sdk_r08-windows\android-sdk-windows\tools , type in: adb -s emulator-5554 shell and hit Enter

5.      Now, type in:  mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system and hit Enter. This will remount the /system in read-write mode. Because we will copy some files to /system/app later, we must set read-write permission to that directory.To do it, type the following: chmod 777/system/app , hit Enter. After that, you need to exit. Type exit, hit Enter again.

6.      Now, you need to remove SdkSetup.apk from /system/app (if it is not removed, the SDK will be restore in nextsession). In the second command prompt window, type: adb shell rm /system/app/SdkSetup.apk , hit Enter.

7.    Backup system.img, copylatesttemp file from D:\Temp\AndroidEmulator\TMPxxx.tmp toC:\Users\Username\.android\avd\Emulator’s name.avd/

On Linux,临时文件位于/tmp/android-<user name>/emulator-xxxx

8.      Close your emulator.

9.      Go to C:\Users\Username\.android\avd\Emulator’s name.avd and delete these two files: userdata-qemu.img and cache.img. and system.img.

10.  Rename temp file to system.img

11.   Launch your emulator inthe normal way.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值