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

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

问题描述

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

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

但即使在尝试此操作后,模拟器在软件 GLES 2.0 模式下运行时也很慢,当我选择硬件 GLES 2.0 作为图形时,我无法启动 avd.它显示启动 avd 几秒钟,然后没有任何反应.有什么我在这里遗漏的吗?

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 ?

推荐答案

所以,问题是 Android SDK 找不到 OpenGL 配置和库.Google 使用 SDK 分发 OpenGL 库,但在 Ubuntu 中该配置已损坏,因为找不到 C++ 库,因此我找到的最佳解决方案是指向您在 Ubuntu 上已有的系统库的符号链接.之前我让您从命令行强制执行该情况的测试,但通过接下来的步骤,您可以获得更持久和更舒适的解决方案,允许您直接从 AVD UI 启动任何硬件加速模拟器.

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.

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

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

/usr/lib/x86_64-linux-gnu/

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

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.

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

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

如果~/yoursdkpath/emulator/lib64/libstdc++/里面有libstdc++6文件,做mv libstdc++6 libstdc++6.bak 来备份它.

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

那么:

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

就是这样,转到 AVD 并在选择硬件 GLES 2.0 配置的情况下启动任何模拟器,它就会工作.

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

重要提示:Google 会不时更新您的模拟器.如果由于某种原因您发现在 Google 更新后模拟器停止从 AVD 启动,请重复此步骤,一切都会恢复正常.

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

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