简体   繁体   English

Android Studio 没有检测到模拟器

[英]Android Studio does not detect the emulator

I am a newbie in Android Studio and I can't test my programs.我是 Android Studio 的新手,我无法测试我的程序。 Before using this I succesfully tested my android programs in eclipse.在使用它之前,我在 eclipse 中成功测试了我的 android 程序。

After reading some questions in similar context I created a new emulator from在阅读了类似上下文中的一些问题后,我创建了一个新的模拟器

Tools-android-AVD Manager

But when I run the program it says No USB devices or running emulators detected(in select deployment target).但是当我运行程序时,它说没有检测到 USB 设备或正在运行的模拟器(在 select 部署目标中)。 How can I fix this我怎样才能解决这个问题

Try this in android studio menu在 android 工作室菜单中试试这个

Tools --> Android --> Enable ADB Integration Tools --> Android --> Enable ADB Integration

if is is already Enabled try to disbale and reenable this works most of time for me.如果已经Enabled ,请尝试disbalereenable这对我来说大部分时间都有效。

Try enabling USB Debuuging in the Android emulator itself, like you would do it on a real device.尝试在Android 仿真器本身中启用USB 调试,就像在真实设备上一样。 Settings-> Developer options-> enable USB Debugging.设置->开发者选项->启用USB调试。

在此处输入图片说明

Trying to cold boot emulator as it has that option but the emulator is not responding to cold boot don't know why?尝试冷启动模拟器,因为它具有该选项但模拟器没有响应冷启动不知道为什么?

Try starting the emulator before opening Android Studio.在打开 Android Studio 之前尝试启动模拟器。

On Mac OS , I ran into this when JAVA_HOME was set incorrectly on a new machine I had just set up.在 Mac OS上,当我刚刚设置的新机器上的JAVA_HOME设置不正确时,我遇到了这个问题。

Resolved by:解决者:

  1. Running java --version showed a pop-up that the JDK was not installed.运行java --version显示未安装 JDK 的弹出窗口。 I clicked the More Info button which took me to a download site.我点击了更多信息按钮,它把我带到了一个下载站点。

  2. Downloaded, and extracted to ~/tools/jdk-15.0.1.jdk下载并解压到~/tools/jdk-15.0.1.jdk

  3. In .bash_profile set JAVA_HOME with full explicit path..bash_profile中使用完整的显式路径设置JAVA_HOME

thanks for Yogesh Kuma感谢Yogesh Kuma

Sometimes wipe data helped.有时擦除数据会有所帮助。

if emulator launched you must close emulator,如果模拟器启动,你必须关闭模拟器,

open device manager -> open menu needed emulator -> wipe data-> you can launch emulator打开设备管理器->打开菜单需要模拟器->擦除数据->你可以启动模拟器

You need to try to find a very small fragment (small Emu rectangle right in the center of the screen) (minimized emulator window) and enlarge it in all directions:)您需要尝试找到一个非常小的片段(屏幕中央的小 Emu 矩形)(最小化的模拟器窗口)并将其向各个方向放大:)

Go to tools->android->AVD manager->then you can see the Android virtual devices . Go 到tools->android->AVD manager->然后就可以看到Android virtual devices了

If you dont have any devices,at the bottom shows create virtual device button then create new Virtual device,If you face issue i'll help you如果您没有任何设备,底部会显示创建虚拟设备按钮然后创建新的虚拟设备,如果您遇到问题,我会帮助您

The answers already provided are correct but since you are a newbie, I would also like to suggest that you don't use an emulator at all. 已经提供的答案是正确的,但是由于您是新手,所以我也建议您完全不要使用模拟器。 Instead, use your real android device for debugging purposes. 相反,请使用真正的android设备进行调试。 Emulators are laggy and slow. 仿真器既缓慢又缓慢。 Just enable "USB Debugging" in your phone's settings and connect your phone to your PC using a USB cable. 只需在手机设置中启用“ USB调试”,然后使用USB电缆将手机连接到PC。 You'll then see your device in the list of available options during deployment. 然后,您将在部署过程中的可用选项列表中看到您的设备。

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

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