简体   繁体   English

无法更改 AVD 管理器 android 工作室中的 Ram 大小

[英]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 解决方案。

  1. Create AVD as usual over AVD Manager像往常一样通过 AVD Manager 创建 AVD
  2. Open location on the disk where AVD data is saved磁盘上保存 AVD 数据的打开位置在此处输入图片说明
  1. open the config file that is there over the notepad.打开记事本上的配置文件。 Inside should be a line that starts with the hw.ramSize line.里面应该是一行以hw.ramSize行开头。 There you should change the number of MB you want.在那里你应该改变你想要的 MB 数。 Save changes, close file.保存更改,关闭文件。
  2. In Android Studio click File > Reload All from Disk在 Android Studio 中单击文件 > 从磁盘重新加载所有
  3. If you select View Details you should see there that ram size is changed now.如果您选择查看详细信息,您应该在那里看到 ram 大小现在已更改。

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:这是屏幕截图: 在此处输入图片说明

Advanced Settings:高级设置: 在此处输入图片说明

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

just get the emulator whith api which has no google play from x86 images,just set your ram size, then change image to the api which has google play it has worked for me creating只需从 x86 图像中获取没有 google play 的 api 模拟器,只需设置您的 ram 大小,然后将图像更改为具有 google play 的 api,它已为我创建

changing ram size改变 ram 大小

changing android image改变安卓形象

selecting android image选择安卓图像

It has worked and I have play market它奏效了,我有游戏市场

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM