android-如何查找应用程序的主要活动的名称? [英] android - how to find the name of the main activity of an application?
本文介绍了android-如何查找应用程序的主要活动的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,我想在代码/命令行中启动Gmail,但是我不知道其主要活动名称.
For example, I want to start Gmail in code/command line, but I don't know its main activity name.
am start -n com.google.android.gm/.XXXXX
可以通过反编译apk来使用,但这很困难.
It's available through decompiling the apk, but it's difficult.
推荐答案
您可以将手机插入计算机并查看DDMS日志,并在其中打印应用程序启动,例如:
You can plug your phone into the computer and look at the DDMS log, application launches are printed there, e.g:
05-11 09:19:15.725: INFO/ActivityManager(96): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x2000000 cmp=com.google.android.gm/.ConversationListActivity bnds=[125,410][235,540] } from pid 2457
所以com.google.android.gm/.ConversationListActivity
似乎是正确的选择,至少,这似乎是图标启动的目的.
So, com.google.android.gm/.ConversationListActivity
, would seem like the right choice, at least, that's what the icon seems to launch.
这篇关于android-如何查找应用程序的主要活动的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文