AOSP x86

编程入门 行业动态 更新时间:2024-10-27 21:11:33
本文介绍了AOSP x86_64 模拟器在 Android Studio 中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-14 23:46:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/851435.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:AOSP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!