近期收到很多同学反馈,mumu12模拟器使用start_app()
启动应用时,会报错:
Traceback (most recent call last):
File "airtest\cli\runner.py", line 75, in runTest
File "site-packages\six.py", line 703, in reraise
File "airtest\cli\runner.py", line 72, in runTest
File "D:\demo\untitled.air\untitled.py", line 10, in <module>
start_app("com.android.browser")
File "airtest\utils\logwraper.py", line 124, in wrapper
File "airtest\core\api.py", line 194, in start_app
File "airtest\core\android\android.py", line 320, in start_app
File "airtest\core\android\adb.py", line 1355, in start_app
File "airtest\core\android\adb.py", line 376, in shell
airtest.core.error.AdbShellError: stdout[b''] stderr[b'/system/bin/sh: monkey: inaccessible or not found\r\n']
小编测试了下,确实存在这个问题,但是换一种方式启动是没问题的:
# -*- encoding=utf8 -*-
__author__ = "AirtestProject"
from airtest.core.api import *
auto_setup(__file__)
shell("am start com.android.browser")
所以大家在使用mumu12,想要启动应用时,不妨直接用Airtest封装的shell
接口好了。
另外小编还测试了下,start_app
这个接口在mumu6模拟器中,时没有问题的,所以大家也可以选择mumu6的模拟器来测试。
关于模拟器还有个常见的问题,就是mumu无法输入中文的情况,之前我们也有给大家详细介绍,大家也可以移步我们之前的推文查阅:Airtest遇到模拟器无法输入中文的情况该如何处理? 。