与Windows 10相比,Android模拟器在ubuntu 17.04上的运行速度极慢 [英] Android emulator running extremly slow on ubuntu 17.04 compared to windows 10

查看:139
本文介绍了与Windows 10相比,Android模拟器在ubuntu 17.04上的运行速度极慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过以下链接安装kvm: https://help.ubuntu.com/community/KVM/安装

但是,即使尝试了这种方法,当在Software GLES 2.0模式下运行并且当我选择Hardware GLES 2.0作为Graphics时,仿真器仍然很慢,但我无法启动avd.它显示了启动avd几秒钟,然后此后没有任何反应.这里有我想念的东西吗?

解决方案

因此,问题是Android SDK无法找到OpenGL配置和库. Google使用SDK分发OpenGL库,但是在Ubuntu中,由于找不到C ++库,因此配置被破坏了,所以我找到的最佳解决方案是将simbolic链接指向您在Ubuntu上已经拥有的系统库.我为您执行的上一个测试使这种情况从命令行强制执行,但是通过后续步骤,您可以拥有一个更永久,更舒适的解决方案,使您可以直接从AVD UI触发任何硬件加速模拟器.

首先,您的系统库位于该Ubuntu路径上:

/usr/lib/x86_64-linux-gnu/

如果/usr/lib/x86_64-linux-gnu/中没有libstdc++.so.6文件,请使用以下文件进行安装:

sudo apt install libstdc++6

在您的情况下,很明显,您已经安装了正确的库,或者仿真器也不会从命令行启动,但是我将上一步留给未在系统上安装正确的库的人./p>

因此,现在我们需要告诉Android SDK我们需要使用系统库.为此,请执行以下操作:

如果~/yoursdkpath/emulator/lib64/libstdc++/中有一个libstdc++6文件,请执行mv libstdc++6 libstdc++6.bak进行备份.

然后:

ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6  ~/yoursdkpath/emulator/lib64/libstdc++/libstdc++.so.6

就是这样,转到AVD并在选择硬件GLES 2.0"配置的情况下启动任何仿真器,它将起作用.

重要提示:Google会不时更​​新您的模拟器.如果由于某种原因您注意到Google更新后仿真器停止从AVD启动,请重复此步骤,所有操作将恢复正常.

I have tried installing kvm from this link: https://help.ubuntu.com/community/KVM/Installation

But even after trying this the emulator is slow when running in Software GLES 2.0 mode and when I select Hardware GLES 2.0 as Graphics I am not able to launch the avd. It shows starting avd for a few seconds and then nothing happens after that. Is there something I am missing here ?

解决方案

So, the problem is that Android SDK cannot find the OpenGL config and libs. Google distributes OpenGL libraries with the SDK but in Ubuntu that config is broken because C++ library could't be found, so the best solution that I found is to point a simbolic link to the system libraries that you already have on Ubuntu. The previous test that I made you to execute forces that situation from command line, but with the next steps you can have a more permanent and confortable solution, allowing you to fire any Hardware Accelerated emulator directly from AVD UI.

First of all, your system libs are on this Ubuntu path:

/usr/lib/x86_64-linux-gnu/

If there's no libstdc++.so.6file present inside /usr/lib/x86_64-linux-gnu/ , please install it with:

sudo apt install libstdc++6

In your situation is pretty obvious that you already have the correct libs installed or the emulators will not start neither from command line, but I leave the previous step for people who don't have the correct lib installed on their systems.

So, now we need to tell the Android SDK that we need to use the system libs. For that just do the following:

If there is a libstdc++6 file inside ~/yoursdkpath/emulator/lib64/libstdc++/ do mv libstdc++6 libstdc++6.bak to backup it.

Then:

ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6  ~/yoursdkpath/emulator/lib64/libstdc++/libstdc++.so.6

And that's it, go to AVD and start any emulator with Hardware GLES 2.0 config selected and it will work.

IMPORTANT: From time to time Google will update your emulators. If for some reason you notice that after a Google update the emulators stop launching from AVD, repeat this steps and all will return to normal.

这篇关于与Windows 10相比,Android模拟器在ubuntu 17.04上的运行速度极慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆