Android设备监视器中未列出“适用于Android的Visual Studio模拟器”设备

时间:2021-05-02 18:55:19

I can start the VS Emulator devices just fine, but they simply don't show up in ADB/Android studio.

我可以很好地启动VS Emulator设备,但它们根本不会出现在ADB / Android工作室中。

I searched and found a similar SO question (same issue, only I installed the standalone emulator) but OP provided a workaround and I would like to know how to actually fix it so it shows up every time as intended instead of having to connect it manually (and as per SO etiquette didn't want to ask there in the comments).

我搜索并发现了一个类似的SO问题(同样的问题,只有我安装了独立模拟器)但是OP提供了一种解决方法,我想知道如何实际修复它,以便它每次按预期显示而不必手动连接(并且根据SO礼仪不想在评论中询问)。

I also found a "solution" in a Microsoft FAQ post which instructs you to edit a registry key under

我还在Microsoft FAQ帖子中找到了一个“解决方案”,它指示您编辑注册表项

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools

HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Android SDK工具

but the 'Android SDK Tools' is nowhere to be found under 'Wow6432Node' in my registry, which could very well be the cause of the problem to begin with. I'm not sure if it's missing because of the Android Studio/SDK installation or something else, but for example Genymotion devices connect to ADB without any problems. (I always feel uneasy about adding anything to registry manually, but maybe I should add the 'PATH' myself?)

但是在我的注册表中的“Wow6432Node”下找不到“Android SDK工具”,这很可能是导致问题开始的原因。我不确定它是否因为Android Studio / SDK安装或其他原因而丢失,但是例如Genymotion设备连接到ADB没有任何问题。 (我总是对手动向注册表添加任何东西感到不安,但也许我应该自己添加'PATH'?)

I installed everything just today on a fresh Windows 10 installation and didn't mess with anything in the registry myself.

我今天刚安装了一些全新的Windows 10安装,并且自己没有在注册表中乱搞任何东西。

Any help is appreciated. Thanks in advance!

任何帮助表示赞赏。提前致谢!

3 个解决方案

#1


20  

I experienced this issue when i moved my android SDK (due to disc space reasons).

当我移动我的android SDK时(由于磁盘空间原因)我遇到了这个问题。

If you open regedit and go to the following registry entry:

如果您打开regedit并转到以下注册表项:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools

HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Android SDK工具

and edit the value Path to look at your new android sdk location it should work.

并编辑值Path以查看它应该工作的新的android sdk位置。

you may have to call:

你可能要打电话:

adb kill-server
adb start-server

and relaunch your emulator again to get adb devices to see it but it should show up in the end

然后重新启动你的模拟器以让adb设备看到它,但它最终应该出现

You may also need to restart your machine just to be safe

为了安全起见,您可能还需要重新启动计算机

#2


10  

In my case I didn't have that entry in registry. But all you need to do is just create the key Android SDK Tools that entry under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node

在我的情况下,我在注册表中没有该条目。但您只需创建HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node下的关键Android SDK工具即可

Then add the two keys as shown (right click -> New -> String Value). Add the correct path to your Android SDK. Here is what it should look like:

然后如图所示添加两个键(右键单击 - >新建 - >字符串值)。添加Android SDK的正确路径。这是它应该是什么样子:

Android设备监视器中未列出“适用于Android的Visual Studio模拟器”设备

Once you add those entries

添加这些条目后

adb kill-server adb start-server

adb kill-server adb start-server

Restart the Visual Studio Emulator for Android then run adb devices and hopefully it should just appear.

重新启动Android的Visual Studio模拟器,然后运行adb设备,希望它只是出现。

#3


7  

  • Copy Your ANDROID SDK PATH for me it look like this : Android设备监视器中未列出“适用于Android的Visual Studio模拟器”设备

    复制你的ANDROID SDK PATH对我来说看起来像这样:

  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools.

    导航到HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node \ Android SDK工具。

Note: if Android SDK Tools folder doesn't exist, Create it under WOW6432Node, And open it, And Create a String Value name it Path :)

注意:如果Android SDK Tools文件夹不存在,请在WOW6432Node下创建,然后打开它,并创建一个字符串值名称为Path :)


  • Modify the Path registry variable to match the path to your Android SDK. Android设备监视器中未列出“适用于Android的Visual Studio模拟器”设备

    修改Path注册表变量以匹配Android SDK的路径。

    • Restart the emulator and you should now be able to see the emulator connected to ADB and associated Android tools.
    • 重新启动模拟器,您现在应该能够看到连接到ADB和相关Android工具的模拟器。


You can read this answers :

你可以阅读这个答案:

Nativescript project running with Visual Studio Emulator

使用Visual Studio Emulator运行的Nativescript项目

#1


20  

I experienced this issue when i moved my android SDK (due to disc space reasons).

当我移动我的android SDK时(由于磁盘空间原因)我遇到了这个问题。

If you open regedit and go to the following registry entry:

如果您打开regedit并转到以下注册表项:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools

HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Android SDK工具

and edit the value Path to look at your new android sdk location it should work.

并编辑值Path以查看它应该工作的新的android sdk位置。

you may have to call:

你可能要打电话:

adb kill-server
adb start-server

and relaunch your emulator again to get adb devices to see it but it should show up in the end

然后重新启动你的模拟器以让adb设备看到它,但它最终应该出现

You may also need to restart your machine just to be safe

为了安全起见,您可能还需要重新启动计算机

#2


10  

In my case I didn't have that entry in registry. But all you need to do is just create the key Android SDK Tools that entry under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node

在我的情况下,我在注册表中没有该条目。但您只需创建HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node下的关键Android SDK工具即可

Then add the two keys as shown (right click -> New -> String Value). Add the correct path to your Android SDK. Here is what it should look like:

然后如图所示添加两个键(右键单击 - >新建 - >字符串值)。添加Android SDK的正确路径。这是它应该是什么样子:

Android设备监视器中未列出“适用于Android的Visual Studio模拟器”设备

Once you add those entries

添加这些条目后

adb kill-server adb start-server

adb kill-server adb start-server

Restart the Visual Studio Emulator for Android then run adb devices and hopefully it should just appear.

重新启动Android的Visual Studio模拟器,然后运行adb设备,希望它只是出现。

#3


7  

  • Copy Your ANDROID SDK PATH for me it look like this : Android设备监视器中未列出“适用于Android的Visual Studio模拟器”设备

    复制你的ANDROID SDK PATH对我来说看起来像这样:

  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools.

    导航到HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node \ Android SDK工具。

Note: if Android SDK Tools folder doesn't exist, Create it under WOW6432Node, And open it, And Create a String Value name it Path :)

注意:如果Android SDK Tools文件夹不存在,请在WOW6432Node下创建,然后打开它,并创建一个字符串值名称为Path :)


  • Modify the Path registry variable to match the path to your Android SDK. Android设备监视器中未列出“适用于Android的Visual Studio模拟器”设备

    修改Path注册表变量以匹配Android SDK的路径。

    • Restart the emulator and you should now be able to see the emulator connected to ADB and associated Android tools.
    • 重新启动模拟器,您现在应该能够看到连接到ADB和相关Android工具的模拟器。


You can read this answers :

你可以阅读这个答案:

Nativescript project running with Visual Studio Emulator

使用Visual Studio Emulator运行的Nativescript项目