Android Studio中的模拟器不会启动

时间:2021-01-05 20:49:25

I think it's a problem with the SDK reference in Project Structure, but when I click run and I choose Launch Emulator nothing appears.

我认为这是项目结构中SDK引用的问题,但是当我点击run并选择Launch Emulator时,什么都没有出现。

31 个解决方案

#1


38  

I had the same problem. I just created the AVD with 768 MB RAM and it did run fine!

我也有同样的问题。我刚刚用768 MB内存创建了AVD,它运行得很好!

#2


25  

I had a similar problem... Android Emulator doesn't open. You need to discover the reason of this... You could run your emulator from the command line. For this you could copy and paste your command line from "Run" or "AVD" Android Studio console. For example:

我也有类似的问题……Android模拟器不开放。你需要找出原因……您可以从命令行运行模拟器。为此,您可以从“Run”或“AVD”Android Studio控制台复制和粘贴命令行。例如:

"{path}\android-sdk\tools\emulator.exe -avd Default_Nexus_5 -netspeed full -netdelay none"

路径“{ } \ android sdk工具\ \模拟器。exe -avd Default_Nexus_5 -netspeed full -netdelay none"

When you launch it from a command line terminal, It give you a message with the error. In my case it was useful for discover the problem:

当您从命令行终端启动它时,它会给您一条带有错误的消息。就我而言,这对发现问题很有用:

..\android-sdk\tools>emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed!

. .\android-sdk\工具>仿真器:错误:x86仿真目前需要硬件加速!请确保英特尔HAXM已正确安装并可用。CPU加速状态:HAX内核模块没有安装!

  • I needed to activate GPU acceleration with a tool to enable it on my machine. I solved it installing from SDK Manager the tool HAXM...

    我需要用一个工具激活GPU加速,使它在我的机器上。我解决了它从SDK管理器安装工具HAXM…

  • I had another problem... For example i had assigned a bad url for skin path of my virtual device... To solve it I have configured my virtual device with a valid skin from my platform sdk: '{path}\android-sdk\platforms\android-{number}\skins{SCREEN_SIZE}'

    我有另一个问题……例如,我为我的虚拟设备的皮肤路径分配了一个糟糕的url……为了解决这个问题,我在我的平台sdk中配置了一个有效的皮肤:“{path}\android-sdk平台\android-{number}皮肤{SCREEN_SIZE}”

Now it is opening fine.

现在一切都很顺利。

#3


9  

It seems that "Waiting for target device to come online ..." is a generic message that appears, always, when the emulator can not start properly. And what's the cause of that? As you can see, there could be many causes.

“等待目标设备上线……”似乎是一个通用的消息,总是在模拟器无法正常启动时出现。原因是什么?正如你所看到的,可能有很多原因。

I think the best way to find the concrete error with the emulator is to start it within a terminal. So:

我认为找到与模拟器的具体错误的最好方法是在一个终端中启动它。所以:

1 - Open a terminal and go to this folder:~/Android/Sdk/tools

1 -打开终端,进入~/Android/Sdk/tools文件夹

2 - Start the emulator with this command:

2 -用以下命令启动模拟器:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none

You can see the name of your (previously created with AVD Manager) emulators with this command:

您可以使用以下命令查看您的(以前使用AVD Manager创建的)仿真器的名称:

./emulator -list-avds

If everything is ok, the program doesn't start, and it writes in the terminal the concrete error.

如果一切正常,程序就不会启动,并在终端中写入具体的错误。

In my case, the application says that there is a problem loading the graphic driver ("libGL error: unable to load driver: r600_dri.so"). As it is explained here, it seems that Google packaged with Android Studio an old version of one library, and the emulator fails when it tries to use my graphic card.

在我的例子中,应用程序说加载图形驱动程序存在问题(“libGL错误:无法加载驱动程序:r600_driso .”)。正如这里所解释的,谷歌似乎与Android Studio打包了一个旧版本的库,当模拟器试图使用我的图形卡时失败了。

Solution? Very easy: to use the system libraries instead of the packaged in Android Studio. How? Adding "-use-system-libs" at the end of the command. So:

解决方案吗?非常简单:使用系统库而不是在Android Studio中打包使用。如何?在命令末尾添加“-use-system-libs”。所以:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none -use-system-libs

The definitive solution is to set the ANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1 for your user/system. With this change, when I run the emulator within Android Studio, it will also load the system libraries.

最终的解决方案是将用户/系统的ANDROID_EMULATOR_USE_SYSTEM_LIBS环境变量设置为1。通过这个更改,当我在Android Studio中运行模拟器时,它也将加载系统库。

PS 1 - The easiest way I found to set the environment variable, it's to modify the script that launch the Android Studio (studio.sh, in my case it is inside /opt/android-stuido/bin), and add at the begining this:

我发现设置环境变量最简单的方法是修改启动Android Studio (Studio)的脚本。在我的例子中,它是inside /opt/android-stuido/bin),并在开始时加上:

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

PS 2 - I work with Debian Jessie and Android Studio 2.2.3. My graphic card is an ATI Radeon HD 6850 by Sapphire.

我和Debian Jessie和Android Studio 2.2.3一起工作。我的图形卡是蓝宝石设计的ATI Radeon 6850。

UPDATE December 2017: I had the same problem with Debian Stretch and Android Studio 3.0.1 (same graphic card). The same solution works for me.

2017年12月更新:Debian Stretch和Android Studio 3.0.1(相同的显卡)也有同样的问题。同样的解决方法对我也适用。

#4


4  

If you are new to Android studio, you need to follow few basics steps in configuring the emulator.

如果您是Android studio的新手,您需要遵循配置模拟器的一些基本步骤。

  1. Make sure you have proper SDK installed
  2. 确保安装了适当的SDK
  3. Make sure you have Intel HAXM & virtualization option enabled in your BIOS
  4. 确保您的BIOS中启用了Intel HAXM和虚拟化选项
  5. Configure emulator correctly, download the Intel X86 Atom system image for better performance.
  6. 正确配置仿真器,下载Intel X86 Atom系统映像以获得更好的性能。

Go through this blog, http://www.feelzdroid.com/2015/05/android-studio-emulator-not-working-solution.html

浏览一下这个博客,http://www.feelzdroid.com/2015/05/android-studio-emulator-not-working solution.html

Here they have explained clearly, what are the problems you face while running & resolution for the same.

这里他们已经解释清楚了,你在运行和解决同样的问题时面临的问题是什么。

#5


3  

1) Open SDK Manager and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven't.

1)打开SDK管理器,如果没有,下载Intel x86仿真器加速器(HAXM安装程序)。

2) Now go to your SDK directory (C:\users\username\AppData\Local\Android\sdk, generally). In this directory Go to extra > intel > Hardware_Accelerated_Execution_Manager and run the file named "intelhaxm-android.exe".

2)现在进入你的SDK目录(C:\用户名\AppData\本地\Android\ SDK)。在这个目录中,转到额外的> intel > Hardware_Accelerated_Execution_Manager,并运行名为“intelhaxm-android.exe”的文件。

In case you get an error like "Intel virtualization technology (vt,vt-x) is not enabled". Go to your BIOS settings and enable Hardware Virtualization.

如果您遇到类似“未启用Intel虚拟化技术(vt,vt-x)”的错误。进入BIOS设置并启用硬件虚拟化。

3) Restart Android Studio and then try to start the AVD again.

3)重启Android Studio,然后尝试重新启动AVD。

It might take a minute or 2 to show the emulator window.

显示仿真器窗口可能需要一分钟或两分钟。

#6


3  

In my case the android hangs at start up. I solved by wiping user data and forcing a cold boot, using Android Virtual Device Manager (AVD at Tools->Android->AVD Manager)

在我的例子中,android在启动时挂起。我使用Android虚拟设备管理器(工具的AVD ->Android->AVD管理器)清除用户数据并强制进行冷启动来解决这个问题。

Android Studio中的模拟器不会启动

#7


2  

I'd like to post a link to this answer as it might help out any persons in this thread running into issues starting a virtual device with more then 768 mb of memory; How to make an AVD with > 768MB RAM To emulate Galaxy devices

我想发布一个这个答案的链接,因为它可能会帮助这个线程中的任何人遇到问题,启动一个内存超过768 mb的虚拟设备;如何使用>768mb RAM制作AVD来模拟Galaxy设备

#8


2  

I have similar problem but I have solved it by switching to "Android 4.2.2 armeabi-v7a" (I needed to test it on Jelly Bean) in my AVD and it fixed the problem for me.

我也有类似的问题,但是我已经在我的AVD中切换到“Android 4.2.2 armeabi-v7a”(我需要在Jelly Bean上进行测试),它帮我解决了这个问题。

What seems to happen is that my processor is AMD and Intel X86 hardware emulation couldn't start. So I changed to use "API" other than "x86" (even though it recommended me to use x86). Hope this helps.

我的处理器是AMD和Intel X86硬件仿真无法启动。所以我改变了使用“API”而不是“x86”(尽管它推荐我使用x86)。希望这个有帮助。

#9


2  

you need to install "Android Emulator"

Go to SDK Manger -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools. and set a hook at Android Emulator

您需要安装“Android仿真器”到SDK管理器—>外观与行为—>系统设置—> Android SDK—> SDK工具。并在Android模拟器上设置一个钩子

#10


1  

It probably won't start because you

它可能不会因为你而开始

OR

  • don't have the correct SDK downloaded
  • 没有下载正确的SDK

If you migrated your project from Eclipse chances are that on running an emulator you will get stuck with this message not seeing anything else:

如果您将项目从Eclipse迁移过来,那么在运行仿真器时,您将无法看到其他信息:

Waiting for device.

等待设备。

If you open the device manager you probably see something like this:

如果你打开设备管理器,你可能会看到这样的东西:

Android Studio中的模拟器不会启动

Just recreate your devices.

重建你的设备。

#11


1  

I've faced similar problem. You can edit the configuration or create new AVD with higher RAM. Also try increasing Heap to 128. Emulator will work smoothly even without HAXM

我也遇到了类似的问题。您可以编辑配置,或者使用更高的RAM创建新的AVD。还可以尝试将堆增加到128。即使没有HAXM,仿真器也能正常工作

#12


1  

I had the same problem. I just Created New AVD with 768 MB RAM and it did run fine for me. I Used for API 22(Lollipop Version).

我也有同样的问题。我刚刚用768 MB内存创建了一个新的AVD,它运行得很好。我使用了API 22(棒棒糖版本)。

#13


1  

Besides using an external emulator such as bluestacks, you can also create a new new AVD and choose a system image with an ABI of armeabi-v7a with an API level of 21, instead of choosing ABI of x86 which fails. I was having the same problem, i tried this and it worked. hope this will be useful as well.

除了使用外部仿真器(如bluestacks),您还可以创建一个新的AVD,并选择一个API级别为21的armeabi-v7a的系统映像,而不是选择x86的ABI,这样会失败。我也遇到过同样的问题,我试过了,它成功了。希望这也能有所帮助。

#14


1  

Check if the following tools are installed or not in the Android SDK Manager as shown in this picture: Android Studio中的模拟器不会启动

检查以下工具是否安装在Android SDK管理器中,如下图所示:

#15


1  

I spent several hours on this problem. What worked for me was opening the Tools->Android->SDK Manager, choosing Android SDK under System Settings on the left of the screen and going to the SDK tools tab. I then unchecked the settings for Android emulator and the Intel x86 Emulator Accelerator. I applied these changes, restarted Android Studio and then re-checked these option and applied the changes. The program reinstalled the emulator components and things seem to work. Hope this helps someone.

我花了几个小时研究这个问题。对我起作用的是打开工具——>Android->SDK管理器,在屏幕左边的系统设置下选择Android SDK,进入SDK Tools选项卡。然后我检查了Android模拟器和Intel x86模拟器加速器的设置。我应用这些更改,重新启动Android Studio,然后重新检查这些选项并应用这些更改。程序重新安装了仿真器组件,似乎一切正常。希望这可以帮助别人。

#16


1  

I had the same issue in Android Studio 2.3.3 on Mac OS X 10.12.6 and the issue was caused by Android Studio using an old version of HAXM (6.0.3 when it should have been 6.2.1):

在Mac OS X 10.12.6上,我在Android Studio 2.3.3中也遇到过同样的问题,这个问题是由Android Studio使用一个旧版本的HAXM(6.0.3当它应该是6.2.1)引起的:

$ kextstat | grep intel
  148    0 0xffffff7f8342c000 0x14000    0x14000    com.intel.kext.intelhaxm (6.0.3) 50449AFC-F7C6-38A0-B820-233E8A050FD6 <7 5 4 3 1>

Removing and reintalling HAXM from within Android Studio according to the instructions didn't work: https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x

根据说明从Android Studio中删除和重新调整HAXM,但没有成功:https://software.intel.com/en- us/android/articles/installationinstructionsfor intel-hardwar-accelerator -mac-os-x

Instead, download the HAXM installer manually or if that link expires, find it under https://software.intel.com/en-us/android/tools under Intel® Hardware Accelerated Execution Manager (Intel® HAXM).

相反,手动下载HAXM安装程序或如果该链接失效,发现它在https://software.intel.com/en-us/android/tools在英特尔®硬件加速执行经理(Intel®HAXM)。

After running the installer, it now shows that the current version of HAXM is installed:

运行安装程序后,现在显示已经安装了当前版本的HAXM:

$ kextstat | grep intel
  169    0 0xffffff7f83472000 0x1d000    0x1d000    com.intel.kext.intelhaxm (6.2.1) 7B6ABC56-699C-3449-A0EC-BEB36C154E3C <7 5 4 3 1>

After upgrading HAXM manually, I'm able to launch x86_64 emulators.

在手动升级HAXM之后,我可以启动x86_64模拟器。


Old answer, which might work instead (note that this didn't work for me for x86_64 images):

旧的答案,它可能会起作用(注意,对于x86_64图像来说,这对我不起作用):

Create a new device:

创建一个新装置:

Tools->Android->AVD Manager

工具- > Android - > AVD管理器

+ Create Virtual Device

+创建虚拟设备

Tablet -> Nexus 7 -> Next

Tablet -> Nexus 7 -> Next。

The Recommended tab should be highlighted.

建议选项卡应该突出显示。

Even though I had the API Level 25 SDK installed, it showed:

虽然我已经安装了API级别25 SDK,但是它显示:

Nougat Download 25 x86 Android 7.1.1 (Google APIs)

Nougat下载25 x86 Android 7.1.1(谷歌api)

So I clicked Download link which seems to have repaired the API Level 25 SDK. I finished creating my new device and it ran fine.

所以我点击了下载链接,似乎已经修复了API 25 SDK。我完成了我的新设备,它运行得很好。

Unfortunately I had already deleted my old device, so if this works for someone else, please leave a comment here to let us know if your original device worked afterwards, thanks!

不幸的是,我已经删除了我的旧设备,所以如果这对其他人有用,请在这里留下评论,让我们知道你的原始设备在之后是否工作,谢谢!

#17


0  

I was having this same problem. I decided to create (see the button at the lower-left). I defined the image to match my device and that seems to work.

我也有同样的问题。我决定创建(参见左下角的按钮)。我定义了与我的设备匹配的图像,这似乎是可行的。

I am thinking with Android Studio at version 1.0.1, there are still plenty of bugs.

我正在考虑使用1.0.1版的Android Studio,仍然有很多bug。

#18


0  

Just check the error log it is necessory that yoou should know the fault. It may be window acceleration HAXM error as mentioned above you have to install it separately in that case... generally the path is c:\users\youruser\appdata\local(run some bat file named like HAXM)

检查错误日志你应该知道错误。可能是上面提到的窗口加速HAXM错误,在这种情况下,您必须分别安装它……通常路径是c:\用户\youruser\appdata\local(运行一些名为HAXM的bat文件)

here the error pops in android studio is and above was the solution to this .. \android-sdk\tools>emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed!

这里android studio中出现的错误就是解决这个问题的方法。\android-sdk\工具>仿真器:错误:x86仿真目前需要硬件加速!请确保英特尔HAXM已正确安装并可用。CPU加速状态:HAX内核模块没有安装!

tell me further if the issue persists altough after this i suppose you will be able to see nexus 5 emulator on screen

如果这个问题继续存在,请进一步告诉我,我想你可以在屏幕上看到nexus 5模拟器

#19


0  

now I use android studio on mac, I have the problem. When I executed emulator in cmdline, I got error message. So I thought that there maybe not was the exe permission on emulator. Then when I added the permission on it by chmod ,everything work.

现在我在mac上使用android studio,我有问题。当我在cmdline中执行仿真器时,我得到了错误消息。所以我认为模拟器上可能没有exe权限。然后当我添加chmod的权限时,一切都可以。

#20


0  

I faced the same problem. From some research that I did I realized that my computer does not support virtualization. so i had to install BLUESTACKS. Believe me it worked...you can also try it.

我也遇到了同样的问题。通过一些研究,我意识到我的计算机不支持虚拟化。所以我必须安装蓝星。相信我这工作…你也可以试试。

  1. Just go to you the directory C:\Android\sdk\platform-tools and double click adb
  2. 只需进入目录C:\Android\sdk\平台工具,双击adb
  3. Ensure that your bluestack is running.
  4. 确保您的bluestack正在运行。
  5. When you try to run the project, it automatically shows up to run with the bluestacks....just choose the bluestack and you are done.
  6. 当你试图运行项目时,它会自动出现运行与bluestacks ....只要选择蓝色就可以了。

If you want the setup of bluestack, just google it you can have a number of sites to download from free.

如果你想要安装bluestack,只要谷歌就可以免费下载很多网站。

#21


0  

One reason could be that the chosen ABI does not fit to your system. For me, only arm64 is working.

一个原因可能是选择的ABI不适合您的系统。对我来说,只有arm64在工作。

Android Studio中的模拟器不会启动 Android Studio中的模拟器不会启动

#22


0  

if you are finding difficult in opening Emulator in Android Studio you can also download genymotion in your android studio.

如果你发现在Android Studio中打开模拟器很困难,你也可以在Android Studio中下载genymotion。

#23


0  

For the me issue was that I had 2 other Android Emulators running. Once I closed those, I was able to start the new one.

对于我来说,我有两个其他的Android模拟器正在运行。一旦我关闭了这些,我就可以开始新的。

#24


0  

I had the same problem, but now I'm using it successfully. As you know, the minimum RAM required to run android studio is 4 GB, but if you only have 4 GB RAM, you probably won't be able to run many other applications at the same time.

我也有同样的问题,但是现在我成功地使用了它。正如您所知道的,运行android studio所需的最小RAM是4 GB,但是如果您只有4 GB的RAM,那么您可能无法同时运行许多其他应用程序。

It's also possible that some windows driver, e.g. graphics, is incompatible. You may want to experiment with software and hardware options for graphics: https://developer.android.com/studio/run/emulator-acceleration.html

也有可能某些windows驱动程序(如图形)不兼容。您可能想要试验图形的软硬件选项:https://developer.android.com/studio/run/emulator- accelerator .html

It might also help to increase the connection timeout in settings/tasks.

它还可以帮助增加设置/任务中的连接超时。

#25


0  

I had the same problem on Windows 10, after I moved my android-SDK folder to D:/ as I was low on space on c:/.

我在Windows 10上遇到了同样的问题,因为我把android-SDK文件夹移到了D:/因为我在c:/上的空间很低。

It turned out that the Android emulator looks for Android SDK via Global (environment) Variables, not the path defined inside Android Studio.

原来,Android模拟器是通过全局(环境)变量查找Android SDK,而不是Android Studio中定义的路径。

So I edited the Environment variable of ANDROID_HOME and that was it.

我编辑了ANDROID_HOME的环境变量。

#26


0  

If your emulator worked fine but suddenly it doesn't, just restart the machine and run again.It worked for me.

如果您的仿真器工作得很好,但是突然就不行,那么就重新启动机器并再次运行。它为我工作。

#27


0  

In Android Studio 2.3.3 I was able to get my AVD to start and run by changing Graphics in the Emulated Performance section from Automatic to Software-GLES 2.0:

在Android Studio 2.3.3中,我可以通过将模拟性能部分中的图形从自动变为软件gles 2.0来启动和运行AVD:

Android Studio中的模拟器不会启动

I was able to infer this after following the advice at https://*.com/a/44931679/1843329 and doing:

在遵循https://*.com/a/44931679/1843329的建议后,我能够推断出这一点。

$ ./emulator -avd Nexus_4_API_21 -use-system-libs

which resulted in:

导致:

emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.

And when I did:

当我做了:

./emulator -avd Nexus_4_API_21 -use-system-libs -gpu off

the emulator then launched.

模拟器启动。

#28


0  

Android Studio中的模拟器不会启动

Wipe data of AVD like that picture and run your program. it's work for me.

删除AVD的数据,如图片,运行程序。这对我的工作。

#29


0  

If you're getting

如果你得到

Failed on eglChooseConfig
Could not initialize emulated framebuffer

See this answer. You may not be in 32-bit color mode, which will cause android GPU emulation to fail.

看到这个答案。您可能不在32位颜色模式中,这将导致android GPU仿真失败。

https://*.com/a/48529994/290072

https://*.com/a/48529994/290072

#30


0  

If anyone is still having trouble with launching the avm take note of the android studio event log when you try to run the avm. When I tried running the avm android studio mentioned that my environment variable ANDROID_SDK_HOME was set to the same place as ANDROID_HOME and it shouldn't be. It recommends deleting the variable ANDROID_SDK_HOME which I did and then restarted android studio and avm started working.

如果有人仍然在运行avm时遇到问题,请注意android studio事件日志。当我尝试运行avm android studio时,我提到我的环境变量ANDROID_SDK_HOME被设置为与ANDROID_HOME相同的位置,而且不应该是这样。它建议删除变量ANDROID_SDK_HOME,我这样做了,然后重新启动android studio, avm开始工作。

#1


38  

I had the same problem. I just created the AVD with 768 MB RAM and it did run fine!

我也有同样的问题。我刚刚用768 MB内存创建了AVD,它运行得很好!

#2


25  

I had a similar problem... Android Emulator doesn't open. You need to discover the reason of this... You could run your emulator from the command line. For this you could copy and paste your command line from "Run" or "AVD" Android Studio console. For example:

我也有类似的问题……Android模拟器不开放。你需要找出原因……您可以从命令行运行模拟器。为此,您可以从“Run”或“AVD”Android Studio控制台复制和粘贴命令行。例如:

"{path}\android-sdk\tools\emulator.exe -avd Default_Nexus_5 -netspeed full -netdelay none"

路径“{ } \ android sdk工具\ \模拟器。exe -avd Default_Nexus_5 -netspeed full -netdelay none"

When you launch it from a command line terminal, It give you a message with the error. In my case it was useful for discover the problem:

当您从命令行终端启动它时,它会给您一条带有错误的消息。就我而言,这对发现问题很有用:

..\android-sdk\tools>emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed!

. .\android-sdk\工具>仿真器:错误:x86仿真目前需要硬件加速!请确保英特尔HAXM已正确安装并可用。CPU加速状态:HAX内核模块没有安装!

  • I needed to activate GPU acceleration with a tool to enable it on my machine. I solved it installing from SDK Manager the tool HAXM...

    我需要用一个工具激活GPU加速,使它在我的机器上。我解决了它从SDK管理器安装工具HAXM…

  • I had another problem... For example i had assigned a bad url for skin path of my virtual device... To solve it I have configured my virtual device with a valid skin from my platform sdk: '{path}\android-sdk\platforms\android-{number}\skins{SCREEN_SIZE}'

    我有另一个问题……例如,我为我的虚拟设备的皮肤路径分配了一个糟糕的url……为了解决这个问题,我在我的平台sdk中配置了一个有效的皮肤:“{path}\android-sdk平台\android-{number}皮肤{SCREEN_SIZE}”

Now it is opening fine.

现在一切都很顺利。

#3


9  

It seems that "Waiting for target device to come online ..." is a generic message that appears, always, when the emulator can not start properly. And what's the cause of that? As you can see, there could be many causes.

“等待目标设备上线……”似乎是一个通用的消息,总是在模拟器无法正常启动时出现。原因是什么?正如你所看到的,可能有很多原因。

I think the best way to find the concrete error with the emulator is to start it within a terminal. So:

我认为找到与模拟器的具体错误的最好方法是在一个终端中启动它。所以:

1 - Open a terminal and go to this folder:~/Android/Sdk/tools

1 -打开终端,进入~/Android/Sdk/tools文件夹

2 - Start the emulator with this command:

2 -用以下命令启动模拟器:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none

You can see the name of your (previously created with AVD Manager) emulators with this command:

您可以使用以下命令查看您的(以前使用AVD Manager创建的)仿真器的名称:

./emulator -list-avds

If everything is ok, the program doesn't start, and it writes in the terminal the concrete error.

如果一切正常,程序就不会启动,并在终端中写入具体的错误。

In my case, the application says that there is a problem loading the graphic driver ("libGL error: unable to load driver: r600_dri.so"). As it is explained here, it seems that Google packaged with Android Studio an old version of one library, and the emulator fails when it tries to use my graphic card.

在我的例子中,应用程序说加载图形驱动程序存在问题(“libGL错误:无法加载驱动程序:r600_driso .”)。正如这里所解释的,谷歌似乎与Android Studio打包了一个旧版本的库,当模拟器试图使用我的图形卡时失败了。

Solution? Very easy: to use the system libraries instead of the packaged in Android Studio. How? Adding "-use-system-libs" at the end of the command. So:

解决方案吗?非常简单:使用系统库而不是在Android Studio中打包使用。如何?在命令末尾添加“-use-system-libs”。所以:

./emulator -avd EMULATOR_NAME -netspeed full -netdelay none -use-system-libs

The definitive solution is to set the ANDROID_EMULATOR_USE_SYSTEM_LIBS environment variable to 1 for your user/system. With this change, when I run the emulator within Android Studio, it will also load the system libraries.

最终的解决方案是将用户/系统的ANDROID_EMULATOR_USE_SYSTEM_LIBS环境变量设置为1。通过这个更改,当我在Android Studio中运行模拟器时,它也将加载系统库。

PS 1 - The easiest way I found to set the environment variable, it's to modify the script that launch the Android Studio (studio.sh, in my case it is inside /opt/android-stuido/bin), and add at the begining this:

我发现设置环境变量最简单的方法是修改启动Android Studio (Studio)的脚本。在我的例子中,它是inside /opt/android-stuido/bin),并在开始时加上:

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

PS 2 - I work with Debian Jessie and Android Studio 2.2.3. My graphic card is an ATI Radeon HD 6850 by Sapphire.

我和Debian Jessie和Android Studio 2.2.3一起工作。我的图形卡是蓝宝石设计的ATI Radeon 6850。

UPDATE December 2017: I had the same problem with Debian Stretch and Android Studio 3.0.1 (same graphic card). The same solution works for me.

2017年12月更新:Debian Stretch和Android Studio 3.0.1(相同的显卡)也有同样的问题。同样的解决方法对我也适用。

#4


4  

If you are new to Android studio, you need to follow few basics steps in configuring the emulator.

如果您是Android studio的新手,您需要遵循配置模拟器的一些基本步骤。

  1. Make sure you have proper SDK installed
  2. 确保安装了适当的SDK
  3. Make sure you have Intel HAXM & virtualization option enabled in your BIOS
  4. 确保您的BIOS中启用了Intel HAXM和虚拟化选项
  5. Configure emulator correctly, download the Intel X86 Atom system image for better performance.
  6. 正确配置仿真器,下载Intel X86 Atom系统映像以获得更好的性能。

Go through this blog, http://www.feelzdroid.com/2015/05/android-studio-emulator-not-working-solution.html

浏览一下这个博客,http://www.feelzdroid.com/2015/05/android-studio-emulator-not-working solution.html

Here they have explained clearly, what are the problems you face while running & resolution for the same.

这里他们已经解释清楚了,你在运行和解决同样的问题时面临的问题是什么。

#5


3  

1) Open SDK Manager and Download Intel x86 Emulator Accelerator (HAXM installer) if you haven't.

1)打开SDK管理器,如果没有,下载Intel x86仿真器加速器(HAXM安装程序)。

2) Now go to your SDK directory (C:\users\username\AppData\Local\Android\sdk, generally). In this directory Go to extra > intel > Hardware_Accelerated_Execution_Manager and run the file named "intelhaxm-android.exe".

2)现在进入你的SDK目录(C:\用户名\AppData\本地\Android\ SDK)。在这个目录中,转到额外的> intel > Hardware_Accelerated_Execution_Manager,并运行名为“intelhaxm-android.exe”的文件。

In case you get an error like "Intel virtualization technology (vt,vt-x) is not enabled". Go to your BIOS settings and enable Hardware Virtualization.

如果您遇到类似“未启用Intel虚拟化技术(vt,vt-x)”的错误。进入BIOS设置并启用硬件虚拟化。

3) Restart Android Studio and then try to start the AVD again.

3)重启Android Studio,然后尝试重新启动AVD。

It might take a minute or 2 to show the emulator window.

显示仿真器窗口可能需要一分钟或两分钟。

#6


3  

In my case the android hangs at start up. I solved by wiping user data and forcing a cold boot, using Android Virtual Device Manager (AVD at Tools->Android->AVD Manager)

在我的例子中,android在启动时挂起。我使用Android虚拟设备管理器(工具的AVD ->Android->AVD管理器)清除用户数据并强制进行冷启动来解决这个问题。

Android Studio中的模拟器不会启动

#7


2  

I'd like to post a link to this answer as it might help out any persons in this thread running into issues starting a virtual device with more then 768 mb of memory; How to make an AVD with > 768MB RAM To emulate Galaxy devices

我想发布一个这个答案的链接,因为它可能会帮助这个线程中的任何人遇到问题,启动一个内存超过768 mb的虚拟设备;如何使用>768mb RAM制作AVD来模拟Galaxy设备

#8


2  

I have similar problem but I have solved it by switching to "Android 4.2.2 armeabi-v7a" (I needed to test it on Jelly Bean) in my AVD and it fixed the problem for me.

我也有类似的问题,但是我已经在我的AVD中切换到“Android 4.2.2 armeabi-v7a”(我需要在Jelly Bean上进行测试),它帮我解决了这个问题。

What seems to happen is that my processor is AMD and Intel X86 hardware emulation couldn't start. So I changed to use "API" other than "x86" (even though it recommended me to use x86). Hope this helps.

我的处理器是AMD和Intel X86硬件仿真无法启动。所以我改变了使用“API”而不是“x86”(尽管它推荐我使用x86)。希望这个有帮助。

#9


2  

you need to install "Android Emulator"

Go to SDK Manger -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools. and set a hook at Android Emulator

您需要安装“Android仿真器”到SDK管理器—>外观与行为—>系统设置—> Android SDK—> SDK工具。并在Android模拟器上设置一个钩子

#10


1  

It probably won't start because you

它可能不会因为你而开始

OR

  • don't have the correct SDK downloaded
  • 没有下载正确的SDK

If you migrated your project from Eclipse chances are that on running an emulator you will get stuck with this message not seeing anything else:

如果您将项目从Eclipse迁移过来,那么在运行仿真器时,您将无法看到其他信息:

Waiting for device.

等待设备。

If you open the device manager you probably see something like this:

如果你打开设备管理器,你可能会看到这样的东西:

Android Studio中的模拟器不会启动

Just recreate your devices.

重建你的设备。

#11


1  

I've faced similar problem. You can edit the configuration or create new AVD with higher RAM. Also try increasing Heap to 128. Emulator will work smoothly even without HAXM

我也遇到了类似的问题。您可以编辑配置,或者使用更高的RAM创建新的AVD。还可以尝试将堆增加到128。即使没有HAXM,仿真器也能正常工作

#12


1  

I had the same problem. I just Created New AVD with 768 MB RAM and it did run fine for me. I Used for API 22(Lollipop Version).

我也有同样的问题。我刚刚用768 MB内存创建了一个新的AVD,它运行得很好。我使用了API 22(棒棒糖版本)。

#13


1  

Besides using an external emulator such as bluestacks, you can also create a new new AVD and choose a system image with an ABI of armeabi-v7a with an API level of 21, instead of choosing ABI of x86 which fails. I was having the same problem, i tried this and it worked. hope this will be useful as well.

除了使用外部仿真器(如bluestacks),您还可以创建一个新的AVD,并选择一个API级别为21的armeabi-v7a的系统映像,而不是选择x86的ABI,这样会失败。我也遇到过同样的问题,我试过了,它成功了。希望这也能有所帮助。

#14


1  

Check if the following tools are installed or not in the Android SDK Manager as shown in this picture: Android Studio中的模拟器不会启动

检查以下工具是否安装在Android SDK管理器中,如下图所示:

#15


1  

I spent several hours on this problem. What worked for me was opening the Tools->Android->SDK Manager, choosing Android SDK under System Settings on the left of the screen and going to the SDK tools tab. I then unchecked the settings for Android emulator and the Intel x86 Emulator Accelerator. I applied these changes, restarted Android Studio and then re-checked these option and applied the changes. The program reinstalled the emulator components and things seem to work. Hope this helps someone.

我花了几个小时研究这个问题。对我起作用的是打开工具——>Android->SDK管理器,在屏幕左边的系统设置下选择Android SDK,进入SDK Tools选项卡。然后我检查了Android模拟器和Intel x86模拟器加速器的设置。我应用这些更改,重新启动Android Studio,然后重新检查这些选项并应用这些更改。程序重新安装了仿真器组件,似乎一切正常。希望这可以帮助别人。

#16


1  

I had the same issue in Android Studio 2.3.3 on Mac OS X 10.12.6 and the issue was caused by Android Studio using an old version of HAXM (6.0.3 when it should have been 6.2.1):

在Mac OS X 10.12.6上,我在Android Studio 2.3.3中也遇到过同样的问题,这个问题是由Android Studio使用一个旧版本的HAXM(6.0.3当它应该是6.2.1)引起的:

$ kextstat | grep intel
  148    0 0xffffff7f8342c000 0x14000    0x14000    com.intel.kext.intelhaxm (6.0.3) 50449AFC-F7C6-38A0-B820-233E8A050FD6 <7 5 4 3 1>

Removing and reintalling HAXM from within Android Studio according to the instructions didn't work: https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x

根据说明从Android Studio中删除和重新调整HAXM,但没有成功:https://software.intel.com/en- us/android/articles/installationinstructionsfor intel-hardwar-accelerator -mac-os-x

Instead, download the HAXM installer manually or if that link expires, find it under https://software.intel.com/en-us/android/tools under Intel® Hardware Accelerated Execution Manager (Intel® HAXM).

相反,手动下载HAXM安装程序或如果该链接失效,发现它在https://software.intel.com/en-us/android/tools在英特尔®硬件加速执行经理(Intel®HAXM)。

After running the installer, it now shows that the current version of HAXM is installed:

运行安装程序后,现在显示已经安装了当前版本的HAXM:

$ kextstat | grep intel
  169    0 0xffffff7f83472000 0x1d000    0x1d000    com.intel.kext.intelhaxm (6.2.1) 7B6ABC56-699C-3449-A0EC-BEB36C154E3C <7 5 4 3 1>

After upgrading HAXM manually, I'm able to launch x86_64 emulators.

在手动升级HAXM之后,我可以启动x86_64模拟器。


Old answer, which might work instead (note that this didn't work for me for x86_64 images):

旧的答案,它可能会起作用(注意,对于x86_64图像来说,这对我不起作用):

Create a new device:

创建一个新装置:

Tools->Android->AVD Manager

工具- > Android - > AVD管理器

+ Create Virtual Device

+创建虚拟设备

Tablet -> Nexus 7 -> Next

Tablet -> Nexus 7 -> Next。

The Recommended tab should be highlighted.

建议选项卡应该突出显示。

Even though I had the API Level 25 SDK installed, it showed:

虽然我已经安装了API级别25 SDK,但是它显示:

Nougat Download 25 x86 Android 7.1.1 (Google APIs)

Nougat下载25 x86 Android 7.1.1(谷歌api)

So I clicked Download link which seems to have repaired the API Level 25 SDK. I finished creating my new device and it ran fine.

所以我点击了下载链接,似乎已经修复了API 25 SDK。我完成了我的新设备,它运行得很好。

Unfortunately I had already deleted my old device, so if this works for someone else, please leave a comment here to let us know if your original device worked afterwards, thanks!

不幸的是,我已经删除了我的旧设备,所以如果这对其他人有用,请在这里留下评论,让我们知道你的原始设备在之后是否工作,谢谢!

#17


0  

I was having this same problem. I decided to create (see the button at the lower-left). I defined the image to match my device and that seems to work.

我也有同样的问题。我决定创建(参见左下角的按钮)。我定义了与我的设备匹配的图像,这似乎是可行的。

I am thinking with Android Studio at version 1.0.1, there are still plenty of bugs.

我正在考虑使用1.0.1版的Android Studio,仍然有很多bug。

#18


0  

Just check the error log it is necessory that yoou should know the fault. It may be window acceleration HAXM error as mentioned above you have to install it separately in that case... generally the path is c:\users\youruser\appdata\local(run some bat file named like HAXM)

检查错误日志你应该知道错误。可能是上面提到的窗口加速HAXM错误,在这种情况下,您必须分别安装它……通常路径是c:\用户\youruser\appdata\local(运行一些名为HAXM的bat文件)

here the error pops in android studio is and above was the solution to this .. \android-sdk\tools>emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed!

这里android studio中出现的错误就是解决这个问题的方法。\android-sdk\工具>仿真器:错误:x86仿真目前需要硬件加速!请确保英特尔HAXM已正确安装并可用。CPU加速状态:HAX内核模块没有安装!

tell me further if the issue persists altough after this i suppose you will be able to see nexus 5 emulator on screen

如果这个问题继续存在,请进一步告诉我,我想你可以在屏幕上看到nexus 5模拟器

#19


0  

now I use android studio on mac, I have the problem. When I executed emulator in cmdline, I got error message. So I thought that there maybe not was the exe permission on emulator. Then when I added the permission on it by chmod ,everything work.

现在我在mac上使用android studio,我有问题。当我在cmdline中执行仿真器时,我得到了错误消息。所以我认为模拟器上可能没有exe权限。然后当我添加chmod的权限时,一切都可以。

#20


0  

I faced the same problem. From some research that I did I realized that my computer does not support virtualization. so i had to install BLUESTACKS. Believe me it worked...you can also try it.

我也遇到了同样的问题。通过一些研究,我意识到我的计算机不支持虚拟化。所以我必须安装蓝星。相信我这工作…你也可以试试。

  1. Just go to you the directory C:\Android\sdk\platform-tools and double click adb
  2. 只需进入目录C:\Android\sdk\平台工具,双击adb
  3. Ensure that your bluestack is running.
  4. 确保您的bluestack正在运行。
  5. When you try to run the project, it automatically shows up to run with the bluestacks....just choose the bluestack and you are done.
  6. 当你试图运行项目时,它会自动出现运行与bluestacks ....只要选择蓝色就可以了。

If you want the setup of bluestack, just google it you can have a number of sites to download from free.

如果你想要安装bluestack,只要谷歌就可以免费下载很多网站。

#21


0  

One reason could be that the chosen ABI does not fit to your system. For me, only arm64 is working.

一个原因可能是选择的ABI不适合您的系统。对我来说,只有arm64在工作。

Android Studio中的模拟器不会启动 Android Studio中的模拟器不会启动

#22


0  

if you are finding difficult in opening Emulator in Android Studio you can also download genymotion in your android studio.

如果你发现在Android Studio中打开模拟器很困难,你也可以在Android Studio中下载genymotion。

#23


0  

For the me issue was that I had 2 other Android Emulators running. Once I closed those, I was able to start the new one.

对于我来说,我有两个其他的Android模拟器正在运行。一旦我关闭了这些,我就可以开始新的。

#24


0  

I had the same problem, but now I'm using it successfully. As you know, the minimum RAM required to run android studio is 4 GB, but if you only have 4 GB RAM, you probably won't be able to run many other applications at the same time.

我也有同样的问题,但是现在我成功地使用了它。正如您所知道的,运行android studio所需的最小RAM是4 GB,但是如果您只有4 GB的RAM,那么您可能无法同时运行许多其他应用程序。

It's also possible that some windows driver, e.g. graphics, is incompatible. You may want to experiment with software and hardware options for graphics: https://developer.android.com/studio/run/emulator-acceleration.html

也有可能某些windows驱动程序(如图形)不兼容。您可能想要试验图形的软硬件选项:https://developer.android.com/studio/run/emulator- accelerator .html

It might also help to increase the connection timeout in settings/tasks.

它还可以帮助增加设置/任务中的连接超时。

#25


0  

I had the same problem on Windows 10, after I moved my android-SDK folder to D:/ as I was low on space on c:/.

我在Windows 10上遇到了同样的问题,因为我把android-SDK文件夹移到了D:/因为我在c:/上的空间很低。

It turned out that the Android emulator looks for Android SDK via Global (environment) Variables, not the path defined inside Android Studio.

原来,Android模拟器是通过全局(环境)变量查找Android SDK,而不是Android Studio中定义的路径。

So I edited the Environment variable of ANDROID_HOME and that was it.

我编辑了ANDROID_HOME的环境变量。

#26


0  

If your emulator worked fine but suddenly it doesn't, just restart the machine and run again.It worked for me.

如果您的仿真器工作得很好,但是突然就不行,那么就重新启动机器并再次运行。它为我工作。

#27


0  

In Android Studio 2.3.3 I was able to get my AVD to start and run by changing Graphics in the Emulated Performance section from Automatic to Software-GLES 2.0:

在Android Studio 2.3.3中,我可以通过将模拟性能部分中的图形从自动变为软件gles 2.0来启动和运行AVD:

Android Studio中的模拟器不会启动

I was able to infer this after following the advice at https://*.com/a/44931679/1843329 and doing:

在遵循https://*.com/a/44931679/1843329的建议后,我能够推断出这一点。

$ ./emulator -avd Nexus_4_API_21 -use-system-libs

which resulted in:

导致:

emulator: ERROR: Could not initialize OpenglES emulation, use '-gpu off' to disable it.

And when I did:

当我做了:

./emulator -avd Nexus_4_API_21 -use-system-libs -gpu off

the emulator then launched.

模拟器启动。

#28


0  

Android Studio中的模拟器不会启动

Wipe data of AVD like that picture and run your program. it's work for me.

删除AVD的数据,如图片,运行程序。这对我的工作。

#29


0  

If you're getting

如果你得到

Failed on eglChooseConfig
Could not initialize emulated framebuffer

See this answer. You may not be in 32-bit color mode, which will cause android GPU emulation to fail.

看到这个答案。您可能不在32位颜色模式中,这将导致android GPU仿真失败。

https://*.com/a/48529994/290072

https://*.com/a/48529994/290072

#30


0  

If anyone is still having trouble with launching the avm take note of the android studio event log when you try to run the avm. When I tried running the avm android studio mentioned that my environment variable ANDROID_SDK_HOME was set to the same place as ANDROID_HOME and it shouldn't be. It recommends deleting the variable ANDROID_SDK_HOME which I did and then restarted android studio and avm started working.

如果有人仍然在运行avm时遇到问题,请注意android studio事件日志。当我尝试运行avm android studio时,我提到我的环境变量ANDROID_SDK_HOME被设置为与ANDROID_HOME相同的位置,而且不应该是这样。它建议删除变量ANDROID_SDK_HOME,我这样做了,然后重新启动android studio, avm开始工作。