Where is the Android emulator source code

这一生的挚爱 提交于 2021-01-28 18:49:27

问题


When I updated my Android Studio a couple of weeks ago, new versions of different components were automatically updated as well.

As was the case with the Android Emulator, I have version 29.2.3-5916265 now which has a bug. Downgrading seems to be very very difficult. In the newest version of the emulator, the layout of emulating GPX-tracks (playing GPX tracks which are then received as real GPS coordinates in the apps of the emulator) was redesigned. It seems that the developers removed the feature to emulate altitude/elevation. Latitude/Longitude still works, but the elevation setting is always 0 although the GPX-tracks which I play back have elevation-tags with real elevation.

I filed a bug with Google, but they do not respond: https://issuetracker.google.com/issues/142411030

My question is: Where can I find the current source code of the Android emulator which packaged with Android Studio. I tried 1 and 2, but both locations do not contain the source code.

There is already a very similar question:(Modifying Android emulator source code), but the answer to this question no longer applies (it seems).

Background: I would like to know why the Android emulator developer (aka Google) removes features and does not answer bug requests, so I would like to find out why the emulation of playing GPX tracks was changed. I can do this only by reading the history of the source changes of the source code.

Any help is really appreciated.

[EDIT]

Finally I found the Android emulator source code and could compile it. There were two design decisions which confused me and which made the search for the right source code an endeavour.

Confusion 1: The source code is really located at 1, but the emulator source code is not contained in all revisions/branches of this repository. For example, if you retrieve the "master" branch, you won't find any directory external/qemu at all. You have to checkout revision emu-master-dev or a revision with a branch prefix "emu" in it to retrieve the source code. The GIT repository for the source code is: https://android.googlesource.com/platform/external/qemu. Better yet to use Gerrit to checkout:

==> mkdir emu-master-dev
==> cd emu-master-dev
==> repo init -u https://android.googlesource.com/platform/manifest -b emu-master-dev
==> repo sync -j8 --fail-fast

Confusion 2: The emulator contains two different GUIs for the Location tab, and which GUI is displayed depends on the compiler variable USE_WEBENGINE. So the bug I was tracking happens when USE_WEBENGINE is defined. When I compile it locally, USE_WEBENGINE is false, so I get an emulator without bug. The emulator which is shipped with AndroidStudio seems to have been compiled with USE_WEBENGINE defined, so there the bug happens.

Thanks for your answers, it led me finally to the correct source code!


回答1:


The emulator source code is located here (at least until the next repo reorganization.)

Good luck!




回答2:


You just don't understand the process of making Images for device. Your Android Studio just loading single file to start virtualization. And to make this Image you simply need AOSP, which you could find in the location you mentioned in the question Android Source.

After setting up repo and pulling initial scripts you can specify goldfish type in the build prop and create Image. This image could be used for virtualization. And this is a source for emulator images. And don't tell that it is not, because we are using the same process for our custom emulators.



来源:https://stackoverflow.com/questions/58714484/where-is-the-android-emulator-source-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!