开发者

Posting an Intent from Python scripts using Monkey/Monkey Runner

开发者 https://www.devze.com 2023-03-02 07:33 出处:网络
I am trying to test my apps using python and monkey runner. I want to send an intent during start activity.

I am trying to test my apps using python and monkey runner. I want to send an intent during start activity. I tried using extras and this doesnt help.

Can some one help me with this? If possible can some one provide me a sample AndroidManifest.xml and test.py on how to do this.

Thank开发者_JAVA技巧 you all for the help blr p sh


There are some bugs in monkeyrunner avoiding correct handling of extras. This question also mentions the case passing booleans, but it's not restricted to them.

The workaround, as monkeyrunner does not do much that invoking ADB in this cases is to use

device.shell('am start -a android.intent.action.MAIN -n my.pkg/.MyActivity -e key val')
0

精彩评论

暂无评论...
验证码 换一张
取 消