错误"活动类不存在"开展与亚行的shell日凌晨开始Android应用程序时, [英] error "activity class does not exist" when launching android app with adb shell am start

查看:413
本文介绍了错误"活动类不存在"开展与亚行的shell日凌晨开始Android应用程序时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ADB安装 -ing我的应用程序,我可以验证它的存在与亚行外壳时列表包AppName的

  

包:air.com.client.AppName

所以,我的知道的它的存在,但是当我尝试用亚行外壳上午开始-a -n android.intent.action.MAIN推出air.com.client它/.AppName ,我得到这个错误:

  

开始:意向{CMP = air.com.client / .AppName}

     

错误类型3

     

错误:Activity类{air.com.client / air.com.client.AppName}不存在

如果它很重要,这是,你可能已经注意到了,一个AIR应用程序,这就是被包装成一个Android应用程序。有任何想法吗?我错过了什么地方?当我使用 AAPT转储xmltree 我可以看到我的apk文件包括一个 android.intent.action.MAIN 项意向过滤器节点,对于它的价值。

最后,理智的缘故,使用相同的命令模板,我可以启动应用程序的设置没有问题:

 亚行外壳上午开始-a -n android.intent.action.MAIN com.android.settings / .Settings
 

解决方案

好不容易才弄明白 - 我留下了提示打开亚行logcat ,然后就开始了我的应用程序设备 - 这项相应的日志条目的:

  

I / ActivityManager(2115):开始U0 {行为= android.intent.action.MAIN猫= [android.intent.category.LAUNCHER] FLG = 0x10200000 CMP = air.com.client.AppName / .AppEntry}从PID 2453

我组建了一个新的命令行:

 亚行shell启动-a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n air.com.client.AppName / .AppEntry
 

......这不正是我想要的。我会说实话,我不明白到底的为什么的它的工作原理,但是这已经足够好了。

After adb install-ing my app, I can verify that it's there with adb shell pm list packages AppName:

package:air.com.client.AppName

So I know it's there, but when I try to launch it with adb shell am start -a android.intent.action.MAIN -n air.com.client/.AppName, I get this error:

Starting: Intent { cmp=air.com.client/.AppName}

Error type 3

Error: Activity class {air.com.client/air.com.client.AppName} does not exist.

If it matters, this is, as you may have noticed, an AIR app that's been packaged as an Android app. Any ideas? Did I miss something somewhere? When I use aapt dump xmltree I can see that my .apk includes an android.intent.action.MAIN entry in the intent-filter node, for what it's worth.

And finally, for sanity's sake, using the same command template I can launch the settings app with no problems:

adb shell am start -a android.intent.action.MAIN -n com.android.settings/.Settings

解决方案

Managed to figure it out - I left a prompt open with adb logcat, then launched my app on the device - out of this corresponding log entry:

I/ActivityManager( 2115): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=air.com.client.AppName/.AppEntry} from pid 2453

I put together a new command line:

adb shell start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n air.com.client.AppName/.AppEntry

... which does exactly what I wanted. I'll be honest, I don't understand exactly why it works, but that's good enough for now.

这篇关于错误"活动类不存在"开展与亚行的shell日凌晨开始Android应用程序时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆