网上有一些命令是错的 本人完善了一下 可以运行
1 启动模拟器emulator -avd test 2.2 -partition-size 128, test为模拟器名字 若不指定分区大小的话,在第5六步会提示out of memory的错误。在真机上没有这个问题。
2 切换到root用户:adb root
3 设置系统目录可写:adb remount
4 复制hosts文件到PC上并修改:adb pull /system/etc/hosts
譬如127.0.0.1 host1.example.com
6 将修改后的hosts复制到模拟器:adb push hosts /system/etc/hosts
1 启动模拟器emulator -avd test 2.2 -partition-size 128, test为模拟器名字 若不指定分区大小的话,在第5六步会提示out of memory的错误。在真机上没有这个问题。
2 切换到root用户:adb root
3 设置系统目录可写:adb remount
4 复制hosts文件到PC上并修改:adb pull /system/etc/hosts
譬如127.0.0.1 host1.example.com
6 将修改后的hosts复制到模拟器:adb push hosts /system/etc/hosts
本文详细介绍了如何解决Android模拟器分区大小不足导致的内存溢出问题,并提供了切换到root用户、设置系统目录可写以及复制、修改hosts文件到模拟器的具体步骤,确保模拟器正常运行。
1969

被折叠的 条评论
为什么被折叠?



