如何从命令行更改 android 模拟器 RAM 大小?

How to change the android emulator RAM size from the command line?(如何从命令行更改 android 模拟器 RAM 大小?)
本文介绍了如何从命令行更改 android 模拟器 RAM 大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在从命令行创建 android 模拟器时编辑或更改内存大小.

I want to edit or change the ram size while creating the android emulator from command line.

EX:创建模拟器时,它采用默认内存大小(Android SDK 4.0.3)512 MB但我想将其增加到 768MB 或减少到 256MB.

EX: While creating the emulator it's taking default ram size(Android SDK 4.0.3) 512 MB But I want to increase it to 768MB or decrease it to 256MB.

我只想更改 Ram 大小.因为可以选择更改 Ram 大小.

I want to change only Ram size. Because there is an option to change the Ram size.

 Do you wish to create a custom hardware profile [no] Yes

如果你输入的是,我们需要提供很多东西.

If you entered yes, we need to provide so many things.

推荐答案

您需要找到您创建的 AVD 的配置文件.

You need to find the config file for the AVD that you have created.

就我而言,我在 Ubuntu 上运行 AVD,所以这是我找到配置文件的地方.

In my case, I'm running the AVD on Ubuntu, so this is where I found the config file.

~/.android/avd/emulator.avd/config.ini

emulator"是我创建 AVD 时提供的名称,因此目录名称将取决于您提供的内容.

"emulator" was the name I provided when I created the AVD, so the directory name will depend on what you provided.

以下是 config.ini 文件中的内容:

The following is what is inside the config.ini file:

hw.lcd.density=240
skin.name=WVGA800
skin.path=platforms/android-8/skins/WVGA800
hw.cpu.arch=arm
abi.type=armeabi
vm.heapSize=64
hw.ramSize=1024
image.sysdir.1=platforms/android-8/images/

我将堆大小从 24 增加到 64,并添加了内存大小参数.

I increased my heap size from 24 to 64, and added the ram size parameter.

有关您可以添加的参数列表,请参阅:从命令行管理 AVD

For the list of parameters you can add, refer to: Managing AVDs from the Command-line

这篇关于如何从命令行更改 android 模拟器 RAM 大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)