使用monkeyrunner startActivity问题 [英] Issues using monkeyrunner startActivity

查看:773
本文介绍了使用monkeyrunner startActivity问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了几个职位在网上,包括Android开发人员网站 http://developer.android .COM /工具/帮助/ monkeyrunner_concepts.html

I have read several posts online, including Android dev website http://developer.android.com/tools/help/monkeyrunner_concepts.html

我无法通过startActivity方法开始一个活动。我曾尝试几个选项。这里有一个例子code:

I can't start an Activity through the startActivity method. I have tried several options. Here's an example code:

package = 'com.mydomain.mypackage'
activity = '.MyActivity'
runComponent = package + '/' + activity
device.startActivity(component=runComponent)

也试过以下code:

Also tried the following code:

package = 'com.mydomain.mypackage'
activity = 'com.mydomain.mypackage.MyActivity'
runComponent = package + '/' + activity
device.startActivity(component=runComponent)

但是,似乎没有任何发射活动。我期待的钱工具启动活动意味着我应该能看到屏幕。

But, nothing seems to launch the activity. I am expecting the money tool to start the activity meaning that I should be able to see the screen.

任何帮助应是AP preciated。

Any help shall be appreciated.

感谢。

推荐答案

我固定它...溶液发现这里的 https://groups.google.com/forum/#​​!topic/android-developers/FvlBxSmNrk0

I fixed it...the solution was found here https://groups.google.com/forum/#!topic/android-developers/FvlBxSmNrk0

例如,如果您(以下简称包的价值
  在AndroidManifest.xml中元素的属性)是
  com.example.test.application和你的主Activity类名
  MainActivity中的Java包com.example.myapp,那么,
  组件名称是

For example, if your (the value of the "package" attribute of the element in your AndroidManifest.xml) is "com.example.test.application" and your main Activity class name "MainActivity" in the Java package "com.example.myapp" then the component name is

com.example.test.application / com.example.myapp.MainActivity

com.example.test.application/com.example.myapp.MainActivity

这篇关于使用monkeyrunner startActivity问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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