appium中used to start the app doesn‘t exist or cannot be launched! Make sure it exists and is a l解决办法

目录

错误收集

错误分析

解决办法

运行结果


错误收集

D:\Program\Util\python.exe C:\Users\Administrator\PycharmProjects\Appium_Real\demo.py 
Traceback (most recent call last):
  File "C:\Users\Administrator\PycharmProjects\Appium_Real\demo.py", line 12, in <module>
    do_driver = webdriver.Remote('127.0.0.1:4723',options=UiAutomator2Options().load_capabilities(cap))
  File "D:\Program\Util\Lib\site-packages\appium\webdriver\webdriver.py", line 253, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        command_executor=command_executor,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        client_config=client_config,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 261, in __init__
    self.start_session(capabilities)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "D:\Program\Util\Lib\site-packages\appium\webdriver\webdriver.py", line 344, in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, w3c_caps)
  File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 454, in execute
    self.error_handler.check_response(response)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "D:\Program\Util\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Activity name '.SplashActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Activity name '.SplashActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity

    at getResponseForW3CError (D:\Program\Util\nvm\nvm\v16.20.2\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\errors.js:1143:9)
    at asyncHandler (D:\Program\Util\nvm\nvm\v16.20.2\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\protocol.js:487:57)

Process finished with exit code 1

错误分析

selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Activity name '.SplashActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
Stacktrace:
UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Cannot start the 'com.tal.kaoyan' application. Consider checking the driver's troubleshooting documentation. Original error: Activity name '.SplashActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity

看上面的东西,我们发现应该是没有找到这个活动页的启动,可能是路径填写错误了

使用 adb shell dumpsys window | find 'mCurrentFocus

查找当前界面'

再检查配置代码,发现这个出现了错误,没有填写完整的路径

解决办法

把完整的类填写上去

或者

写成下面的这样,可以省略共有的前缀

ui.activity.SplashActivity

运行结果

已经可以正常使用了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值