Android 模拟器除了黑屏什么都不显示,adb 设备显示“设备离线"; [英] Android emulator shows nothing except black screen and adb devices shows "device offline"

查看:24
本文介绍了Android 模拟器除了黑屏什么都不显示,adb 设备显示“设备离线";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想开始在 Android 中进行开发.因此,问题是当我尝试通过发出命令 emulator @A2 来启动模拟器时,屏幕上会出现一个模拟器.但即使等待了长达 2-3 小时,它所显示的也只是黑屏.甚至没有 android 主屏幕或 android 标志.就是黑屏.虽然最初adb devices"将模拟器显示为离线.2-3 分钟后,连接的设备列表变为空白.

I am just trying to start development in Android. So, the problem is that when I try to launch an emulator by issuing the command emulator @A2 , an emulator comes up on the screen. But even after waiting for as long as 2-3 hrs, all it shows is a black screen. Not even the android home screen or the android logo. Just a black screen. And while initially "adb devices" shows the emulator as offline.after 2-3 minutes the list of attached devices becomes blank.

我在网上搜索并尝试了那里提到的所有步骤,例如杀死并重新启动 adb,在没有空格的目录中安装 java/android,但无济于事.

I searched all over net and tried all the steps mentioned there like kill and restart adb, install java/android in a directory without spaces, but to no avail.

我的 Jdk 和 Android 安装在以下文件夹中:

My Jdk and Android installations are in following folders:

C:Java32BitInstallationC:AndroidSdk安装这是我为它下载/安装的东西的列表:

C:Java32BitInstallation C:AndroidSdkInstallation Here's the list of stuff I have downloaded/installed for it:

  1. Android SDK 工具,修订版 13
  2. Android SDK 平台工具,修订版 10
  3. SDK 平台 Android 4.0.3,API 15,修订版 1
  4. jdk jdk-7u3-windows-i586

在我的 path 变量中,我添加了 *C:AndroidSdkInstallationandroid-sdkplatform-tools;C:AndroidSdkInstallationandroid-sdk ools;C:Java32BitInstallation;C:Java32BitInstallationin*

In my path variable, I have added *C:AndroidSdkInstallationandroid-sdkplatform-tools;C:AndroidSdkInstallationandroid-sdk ools;C:Java32BitInstallation;C:Java32BitInstallationin*

也在从网上某处阅读之后,我添加了 JAVA_HOME 变量,其值为 C:Java32BitInstallation 但仍然没有用.

Also after reading somewhere from net I have added JAVA_HOME variable with its value as C:Java32BitInstallation But still no use.

我的系统上同时安装了 IntelliJ 和 Eclipse.但由于启动模拟器,我没有使用任何这些,我不怀疑这些有任何不妥.

I have both IntelliJ and Eclipse installed on my system. But since for starting the emulator, I am not using any of these, I dont suspect any foulplay with these.

那么,谁能帮我解决这些让我发疯的事情.我尝试了过去 10-12 天,一直无法启动模拟器,更不用说编写我的第一个Hello world"程序了.

So, can anyone please help me with this stuff that's driving me crazy. I am trying for past 10-12 days and have not been able to start the emulator, let alone write my first "Hello world" program.

补充说明:我的系统是 Windows 7(64 位)机器.早些时候我安装了 64 位版本的 jdk,但那个时候也出现了问题.现在在互联网上搜索后,我卸载了它并安装了 32 位版本的 Java.但是,又没用.但是有一件事,这个 32 位版本的 java(jdk 7 update 3),首先安装 jre 作为 jdk 安装的一部分,然后安装 jre 7 .所以现在我在 C:Java32BitInstallation 目录中有 2 个文件夹:jre 和 jre7.这是否与我的模拟器没有出现有关.我是否需要指定额外的环境变量或修改现有的变量?请帮忙.

Additional notes: My system is a windows 7 (64 bit) machine. Earlier I had installed 64 bit version of jdk, but the problem was present that time too. Now after searcching on internet, I uninstalled that and installed 32 bit version of Java. But, again no use. One thing, though, this 32 bit version of java (jdk 7 update 3), first install jre as part of jdk installation and then installs jre 7 . So now I have 2 folders: jre and jre7 in the C:Java32BitInstallation directory. Could this have to do anthing with my emulator not turning up. Do I need to specify aditional environmetal variables or modify the existing one? Kindly help.

顺便说一句,我有没有提到 logcat 什么也没显示.

BTW, did I mention the logcat shows nothing.

推荐答案

25.07.2018 更新:

最新的Android Studio 版本已经没有这个选项了.如果问题仍然存在,请尝试在模拟性能"的值之间切换.验证配置对话框(如果可用)中的下拉菜单或参考配置模拟器图形渲染和硬件加速.

The latest Android Studio version does not have this option anymore. If the problem persists try to switch between the values of the "Emulated Performance" dropdown in the Verify Configuration dialogue (if available) or refer to the Configure Emulator graphics rendering and hardware acceleration.

2014 年 2 月 26 日更新:

配置图形加速有两个提示来自 developer.android.com 的章节.

There are two hints in the Configuring Graphics Acceleration chapter from developer.android.com.

注意:从 SDK Tools Revision 17 开始,模拟器的图形加速功能是实验性的;使用此功能时请注意不兼容和错误.

Caution: As of SDK Tools Revision 17, the graphics acceleration feature for the emulator is experimental; be alert for incompatibilities and errors when using this feature.

启动 AVD 管理器并创建一个目标值为 Android 4.0.3(API 级别 15),修订版 3 或更高版本的新 AVD.

Start the AVD Manager and create a new AVD with the Target value of Android 4.0.3 (API Level 15), revision 3 or higher.

所以 Android 4.0.3(API Level 15)似乎是图形加速的最低要求.

So Android 4.0.3 (API Level 15) seems to be the minimum requirement for graphics acceleration.

原答案

我在使用最新的 Android SDK 时遇到了同样的问题.

I have had the same issue with the latest Android SDK.

我只是取消了复选框使用主机 GPU";在虚拟设备的设置中,它又开始工作了.

I simply deactivated the checkbox "Use Host GPU" within the settings of the virtual device and it started working again.

使用主机 GPU"仅适用于 Android 4.2 作为目标"的我.

The "Use Host GPU" does only work for me with Android 4.2 as "Target".

这篇关于Android 模拟器除了黑屏什么都不显示,adb 设备显示“设备离线";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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