免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1346 | 回复: 0
打印 上一主题 下一主题

[Android] 从模拟器永久删除系统apk [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-23 01:46 |只看该作者 |倒序浏览
这里介绍的方法是无需重新打包system.img以及可以从system.img中永久删除系统apk。

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

2.       Modify hardware-qemu.ini, change:

disk.systemPartition.initPath = C:\Users\Username\.android\avd\Emulator’s name.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 your emulator. Please don’t try to launch it from SDK manager, otherwise, it won’t work.

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

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 next session). In the second command prompt window, type: adb shell rm /system/app/SdkSetup.apk , hit Enter.

7.     Backup system.img, copy temp file from C:\Users\UserName\AppData\Local\Temp\AndroidEmulator\ to C:\Users\Username\.android\avd\Emulator’s name.avd/

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. 

10.   Rename temp file to system.img

11.   Launch your emulator in the normal way.

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP