如何找出服务(不在我的应用程序中)的启动意图?

Oas*_*eng 8 debugging android android-intent

我想了解Google地图服务是如何自动启动的.

当我转储主缓冲区或事件缓冲区的logcat时,我只能找到谷歌地图的哪个组件启动,但没有关于"谁"(包)启动它的线索,以及"如何"(意图)?

有没有可用于查找它们的调试方法?

Oas*_*eng 2

我设法找到了“How”,但仍然没有找到“Who”的线索。

“如何”

运行dumpsys activity services,查看该intent字段:

* ServiceRecord{41526f40 u0 com.google.android.apps.maps/com.google.android.location.internal.server.GoogleLocationService}

  intent={act=com.google.android.location.internal.GMM_NLP}

  packageName=com.google.android.apps.maps
Run Code Online (Sandbox Code Playgroud)