简体   繁体   English

从Android Studio终端运行Android模拟器

[英]Running Android Emulator from Android Studio terminal

I am trying to learn about creating Android Apps, using Android Studio 3.1.2 我正在尝试学习有关使用Android Studio 3.1.2创建Android应用程序的信息

I want to run this app on an emulator, so I created an Emulator called it OREO Emulator . 我想在模拟器上运行此应用程序,因此我创建了一个名为OREO Emulator的模拟器

But whenever I press the run button, I get a GPU error, and went to this thread , one of the solutions is to use Android Studio Terminal, go to the address where the emulator is located, and type in the following command 但是,每当我按下运行按钮时,我都会遇到GPU错误,并转到该线程 ,解决方法之一是使用Android Studio终端,转到模拟器所在的地址,然后键入以下命令

emulator -avd [avd_name] -gpu [mode]

But unfortunately that address doesn't exist in my laptop, so what I should type in the terminal is: 但是不幸的是,我的笔记本电脑中不存在该地址,因此我应该在终端中输入的是:

emulator -avd OREO_Emulator -gpu host but when I do that it says that emulator is not recognised as a command. emulator -avd OREO_Emulator -gpu host但是当我这样做时,它说模拟器无法识别为命令。

Can anyone help me with that. 谁能帮助我。

Thank you in advance 先感谢您

在此处输入图片说明

You first must open the Path of the folder: 您首先必须打开文件夹的路径:

cd C:\\Users\\userName\\AppData\\Local\\Android\\Sdk\\emulator cd C:\\ Users \\ userName \\ AppData \\ Local \\ Android \\ Sdk \\ emulator

Where userName is your user in case of Windows 如果是Windows,则userName是您的用户

After If you want you could add the PATH to the envoriment variables in order to dont need to open the folder path every time that you need it. 之后如果需要,您可以将PATH添加到envoriment变量中,以便不必在每次需要时都打开文件夹路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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