AOSP x86_64模拟器在Android Studio中不可见 [英] AOSP x86_64 Emulator not visible in Android Studio
问题描述
我正在使用AOSP模拟器来测试我的代码. 我在我的电脑上下载了AOSP的android10_release源代码. 然后使用以下命令
I am using AOSP emulator for testing my code. I downloaded the android10_release source code of AOSP in my pc. Then used the following commands
source build/envsetup.sh
set_stuff_for_environment
lunch aosp_x86_64-eng
make -j6
emulator
现在,在运行这些命令之后,我就可以在PC中成功运行模拟器了 我电脑的操作系统是Ubuntu 18.04 我还安装了许多可用于AOSP的库,如AOSP网站中所述的jdk-8,python,curl,repo,git以及其他内容.
now after running these commands I am successfully able to run emulator in my pc OS of my pc is Ubuntu 18.04 I also installed many libraries for working with AOSP like jdk-8, python, curl, repo, git, and other stuff as per described in AOSP website
我很希望通过执行以下命令来看到我的模拟器在终端中运行
I am abe to see my emulator running in terminal by executing following commands
$ adb devices
连接的设备列表 emulator-5554设备
List of devices attached emulator-5554 device
我还可以通过执行以下命令将apk安装在此模拟器中
I am also able to install my apk in this emulator by executing following commands
$ adb install myapp.apk
它已经安装好,我可以在模拟器中看到它
and it gets installed and I can see it in emulator
现在问我一个问题
为什么此模拟器未在设备的Android Studio中显示 即使我在android studio中对adb连接进行故障排除时,它也会显示我的模拟器正在运行,但未显示在可用设备中.
Why this emulator not showing in Android studio in devices Even when I troubleshoot the adb connections in android studio it shows my emulator running but not showing in available devices.
推荐答案
或通过网络adb connect localhost:5555
连接到它-端口号比仿真设备的串行端口高1(默认情况下为emulator-5554).
然后它在Android Studio中可见,并且可以正常工作.
Or connect to it via network adb connect localhost:5555
- port number is one higher than emulated device serial (in default case emulator-5554).
Then it is visible in Android studio and it works without issues.
最适合我的解决方案(在两台不同的计算机上尝试过):
solution that works for me (tried on two different machines):
$ cd aosp
$ repo init -u https://android.googlesource.com/platform/manifest -b android-10.0.0_r29
...
$ repo sync
...
$ . build/envsetup.sh
$ lunch sdk_phone_x86
$ m -j16
等待aosp构建
$ emulator &
$ adb devices
List of devices attached
emulator-5554 device
$ adb connect localhost:5555
connected to localhost:5555
$ adb devices
List of devices attached
emulator-5554 device
localhost:5555 device
启动Android Studio(已通过3.5.3和3.6.0测试)
start Android Studio (tested with 3.5.3 & 3.6.0)
在设备列表中,我看到:"x86的未知Android SDK构建",旁边有一个小绿点.
In the devices list I see: "unknown Android SDK build for x86" with a little green dot next to it.
当我单击运行或调试"时,一切正常
When I click on Run or Debug everything works
这篇关于AOSP x86_64模拟器在Android Studio中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!