首页 > 解决方案 > Where is the Android emulator source code

问题描述

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!

标签: androidemulation

解决方案


模拟器源代码位于此处(至少在下一次 repo 重组之前。)

祝你好运!


推荐阅读