[英]Can't change the Ram size in AVD manager android studio
I'm not able to change the ram size in the memory and storage section of the AVD manager in the android studio.我无法更改 memory 中的内存大小和 android 工作室中 AVD 管理器的存储部分。 I wanted the emulator to run a little faster (I have 8GB RAM).
我希望模拟器运行得更快(我有 8GB RAM)。 The controls are completely gray out.
控件完全变灰。
If you create an AVD with " Recommended " system image then you can't change the " Memory and Storage " parameters neither when you create AVD nor when you edit your AVD.如果您使用“推荐”系统映像创建 AVD,那么无论是在创建 AVD 还是编辑 AVD 时,您都无法更改“内存和存储”参数。
Solution:解决方法:
You should select your " Image " from " x86 Images " tab and then change " Memory and Storage " parameters in the next page.您应该从“ x86 图像”选项卡中选择“图像”,然后在下一页更改“内存和存储”参数。
It happened to me with an image with the pre-installed playstore app.它发生在我身上,带有预装的 Playstore 应用程序的图像。 Maybe it is an android SDK bug.
也许这是一个android SDK错误。 Try to create one with no playstore app.
尝试创建一个没有 Playstore 应用程序的应用程序。
Look for your avd folder, then look for the folder of the image you want to change and edit the config.ini.查找您的 avd 文件夹,然后查找您要更改的图像的文件夹并编辑 config.ini。 change the value of
改变值
hw.ramSize
Here is a solution for Android 4.1 that worked for me.这是适用于我的 Android 4.1 解决方案。
hw.ramSize
line.hw.ramSize
行开头。 There you should change the number of MB you want. I hope it will help.我希望它会有所帮助。
编辑被禁用,但您可以使用克隆设备.. 选项创建新的虚拟设备。操作系统安装完成后,在单击完成之前再次在高级设置中编辑 RAM。
Further adding to the answer by Fresher, it seems that even x86 images don't work(atleast its the case with my mac OS).进一步补充 Fresher 的答案,似乎即使 x86 图像也不起作用(至少在我的 mac OS 中是这样)。 Here is the screenshot:
这是屏幕截图:
What worked for me: I just used "Clone Device" in Hardware selection wizard(the first one that opens after you click on the "AVD manager"什么对我有用:我只是在硬件选择向导中使用了“克隆设备”(单击“AVD 管理器”后打开的第一个向导)
Then setup your ram here:
然后在这里设置你的内存:
Once you hit "Finish", you will see your cloned device appear in the hardware selection wizard like this:
点击“完成”后,您将看到您的克隆设备出现在硬件选择向导中,如下所示:
Then go ahead as usual.然后像往常一样继续。
您可以通过编辑avd
设置查找此 int 的config.ini
文件来执行此操作
>hw.ramSize
First of all the top answer is wrong, you can change the storage with recommended settings, but you can't change the memory amount, that is, the physical ram or virtual ram, on the device.首先最上面的答案是错误的,你可以用推荐设置更改存储,但你不能更改设备上的 memory 数量,即物理内存或虚拟内存。
What you need to do is go to your virtual device manager in studio.您需要做的是将 go 发送到工作室中的虚拟设备管理器。 Create a new device, at the select hardware screen, whatever type of virtual device you are going to be using, go find it in the list say, Pixel 6 or whatever, and right click the pixel 6 and click clone.
创建一个新设备,在 select 硬件屏幕上,无论您要使用哪种类型的虚拟设备,go 在列表中找到它,比如 Pixel 6 或其他,然后右键单击像素 6 并单击克隆。 Then while you have that selected, right click and select edit profile.
然后当你选择它时,右键单击和 select 编辑配置文件。 Or you can just click new hardware profile and build it from scratch.
或者您可以单击新的硬件配置文件并从头开始构建它。
Whichever route you choose just name the clone or the new profile to MYPIXEL or something distinguishable from the rest of the group, whatever.无论您选择哪种方式,只需将克隆或新配置文件命名为 MYPIXEL 或与该组的 rest 区别开来的名称即可。 Then go down to the section where it has the virtual memory and the physical memory, and storage and input whatever values you want.
然后 go 到它有虚拟 memory 和物理 memory 的部分,然后存储和输入你想要的任何值。 Remember, you're not setting these values for the amount your device will have when you boot it up here, this is just the hardware profile where you are setting the maximum allowance for the device just be mindful of that you still have to change the settings on the verification page to the value that you want
请记住,您没有将这些值设置为您的设备在此处启动时将拥有的数量,这只是您设置设备最大允许量的硬件配置文件,请注意您仍然需要更改验证页面上的设置为您想要的值
So now when you set the hardware profile wherever you want it to be, save it click okay and then make sure you have it selected when you click next to go select your system image.所以现在当你在任何你想要的地方设置硬件配置文件时,保存它点击确定然后当你点击 go select 你的系统图像旁边时确保你已经选择了它。 Pick your system image and then click next again, and then this is the verify configuration screen, you still have to expand the advanced options and configure the particular values you want for virtual and physical and storage space.
选择您的系统映像,然后再次单击下一步,然后这是验证配置屏幕,您仍然需要展开高级选项并配置您想要的虚拟和物理以及存储空间的特定值。 now you'll see when you go into the advance configuration options you can modify the virtual and physical memory. because when you open it up it's still going to have that standard 2038 MB or whatever the number is because that is the default amount for that particular device but you will be able to change it to whatever maximum threshold you set.
现在你会看到当你 go 进入高级配置选项时你可以修改虚拟和物理 memory。因为当你打开它时它仍然会有标准的 2038 MB 或任何数字因为这是默认数量特定设备,但您可以将其更改为您设置的任何最大阈值。
That's how you do it the right way from the beginning.这就是你从一开始就以正确的方式做事的方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.