问题描述
限时送ChatGPT账号..我正在使用 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
现在运行这些命令后,我可以成功地在我的电脑上运行模拟器我电脑的操作系统是 Ubuntu 18.04我还安装了许多用于处理 AOSP 的库,如 jdk-8、python、curl、repo、git 和其他在 AOSP 网站上描述的东西
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
连接的设备列表模拟器-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 连接进行故障排除,它也会显示我的模拟器正在运行,但未显示在可用设备中.
推荐答案
或者通过网络连接到它 adb connect localhost:5555
- 端口号比模拟设备的串口号高一个(默认情况下是模拟器-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/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)
在设备列表中,我看到:未知的 Android SDK build for x86",旁边有一个小绿点.
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屋!
更多推荐
[db:关键词]
发布评论