测试 Android 内存不足的情况
有没有一个好的方法来测试 Android 内存不足的情况?我希望能够专门选择在模拟器上运行的应用程序并强制模拟器回收其活动堆栈。我知道有一种方法可以通过仪器测试用例来验证活动的不同部分(http://developer.android.com/guide/topics/testing/activity_testing.html)。
想知道是否还有其他方法可以强制应用程序自动执行此操作。
Is there a good way of testing androids for out of memory scenarios? I'd like to be able to specifically choose an application running on the emulator and force the emulator to recycle its activity stack. I know there's a way to verify different parts of your activities via Instrumentation Test Cases (http://developer.android.com/guide/topics/testing/activity_testing.html).
Wondering if there's anything else that can force the application to do it automatically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 MonkeyRunner 工具怎么样?您可以对其进行编程以运行所需的多种场景,例如屏幕旋转、完成活动等。它可以满足您问题的目的。
http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
还有猴子应用程序练习器:
http://developer.android.com/guide/developing/tools/monkey.html
What about using the MonkeyRunner tool? You can program it to run through however many scenarios needed e.g. screen rotations, finishing activities, etc. etc. It could server the purpose of your question.
http://developer.android.com/guide/developing/tools/monkeyrunner_concepts.html
There's also the monkey application exerciser:
http://developer.android.com/guide/developing/tools/monkey.html