英文:
Why Does emulator under Android Studio Electric Eel now run twice when targeting same Android version & start app in both copies?
问题
以下是您要翻译的内容:
背景
我正在尝试运行两个副本的Android Studio Electric Eel(版本详细信息在本帖底部),分别运行两个不同的项目。
我将两个应用都定位到Pixel 6 API 31(每个应用在自己的Android Studio窗口中)。
问题
过去,当我为两个项目定位相同的设备时,应用程序会启动在同一个模拟器实例上。
现在,应用程序在运行相同API(31)的新模拟器上启动,并在两个模拟器上同时运行应用程序:
下面是两个相同模拟器实例的快照(不用担心,所有这些密钥都是测试密钥,不需要受保护):
注意模拟器显示它们是相同的
在模拟器的顶部,您可以看到它们都运行相同版本的API 31。
为什么现在会发生这种情况?
我以前运行过两个Android Studio窗口,如果定位相同的模拟器,那么不会打开新的模拟器窗口。现在似乎Electric Eel会打开一个新的模拟器窗口,但同时在两个模拟器上运行应用程序。
这似乎是一个错误。
当我在启动应用程序的Android Studio窗口中单击“停止”时,两个模拟器上的应用程序都会关闭。
是否有新的配置?
是否有我不知道的新配置设置,告诉它只运行一个实例?
附加信息:使用模拟器按钮
如果我转到Android Studio窗口中的一个,并单击右下角显示的Emulator按钮(如下图所示),则只有一个模拟器会响应 - 让我们称之为模拟器1。
如果我切换到运行的另一份Android Studio的副本,并单击相同的按钮,只有一个模拟器会响应 - 让我们称之为模拟器2。
因此,AS知道模拟器是不同的,但然后在两者上启动应用程序,为什么?
已提交为错误
现在我通过了这个问题,我认为这一定是一个错误,所以我将其提交给了Android Studio团队。
https://issuetracker.google.com/issues/277630896
Android Studio版本详细信息
Android Studio Electric Eel | 2022.1.1 补丁2版本
#AI-221.6008.13.2211.9619390,建立于2023年2月16日
运行时版本:11.0.15+0-b2043.56-8887301
amd64 VM:OpenJDK 64位服务器VM由JetBrains s.r.o.制作的Linux 5.19.0-38通用版 GC:G1年轻代,
G1旧代内存:2048M内核:12注册表:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
当前桌面:ubuntu:GNOME
英文:
Background
I'm attempting to run two copies of Android Studio Electric Eel (version details are at bottom of this post) running two different projects.
I'm targeting a Pixel 6 API 31 with both apps (each app in its own Android Studio window).
The Problem
In the past, when I would target the same device for both projects then the app would start on the same emulator instance.
Now, the app starts a new emulator running the same API (31) and runs the app on both emualtors:
Here's a snapshot of two instances of the same emulator running (no worries all those keys are testing keys and do not need to be protected):
Notice the Emulator Shows They Are the Same
At the top of the emulator you can see that they are running the same version of the API 31.
Why does this happen now?
I've run two Android Studio Windows in the past and if you target the same emulator then a new emulator window was not opened. Now it seems that Electric Eel opens a new emulator window but runs the app on both at the same time.
This seems like a bug.
When I click Stop in the Android Studio window where I started the app, then the app closes on both emulators.
Is There a New Configuration?
Is there a new configuration setting that I don't know about, that tells it to run one instance?
Additional Info : Using the Emulator (button)
If I go to one of the Android Studio windows and click the Emulator button along the bottom right side (shown in next image) then only one emulator responds -- let's call this one Emulator 1.
If I go the other copy of AndroidStudio which is running and click that same button, only one emulator responds -- let's call this one Emulator 2.
So, AS knows that the emulators are different but then starts the app on both, Why?!
Submitted As a Bug
Now that I worked through this I decided that it must be a bug and I submitted it to the Android Studio team.
https://issuetracker.google.com/issues/277630896
Android Studio Version Details
> Android Studio Electric Eel | 2022.1.1 Patch 2 Build
>
> #AI-221.6008.13.2211.9619390, built on February 16,
> 2023 Runtime version: 11.0.15+0-b2043.56-8887301
> amd64 VM: OpenJDK 64-Bit Server VM
>
> by JetBrains s.r.o. Linux 5.19.0-38-generic GC: G1 Young Generation,
>
> G1 Old Generation Memory: 2048M Cores: 12 Registry:
>
>> external.system.auto.import.disabled=true
>>
>> ide.text.editor.with.preview.show.floating.toolbar=false
Current Desktop: ubuntu:GNOME
答案1
得分: 1
只有一个运行中的模拟器,但在Studio中显示了两次。每个项目都有自己的窗口,因此有自己的模拟器工具窗口。每个模拟器工具窗口显示所有运行中的模拟器,因为模拟器与项目无关。
英文:
There is only one running emulator, but it is shown twice in Studio. Each project has its own window and therefore its own Emulator tool window. Each Emulator tool window is showing all running emulators because emulators are not tied to projects.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论