How to get application error with MonkeyRunner?
The "Force close" or "ANR" pop up when MonkeyRunner is running. How MonkeyRunner开发者_StackOverflow社区 get the "Force close" or "ANR" error and stop script. Thank you very much.
If you have monekyrunner open you need to use ctrl+d to stop it. If you are using a script then you need to use sys.exit(1)
. (you'll need to import sys)
To see if you got a force close you will need to use subprocess to make a subprocess to monitor the log for force closes.
精彩评论