import os
from selenium import webdriver

PATH = lambda p: os.path.abspath(
    os.path.join(os.path.dirname(__file__), p)
)

desired_caps = {}
desired_caps['deviceName'] = '6TZPJZGEAUK7TOWG'
desired_caps['platformName'] = 'Android'
desired_caps['browserName'] = ''
desired_caps['version'] = '4.2'
#desired_caps['app'] = PATH(r'C:\Users\mazhigang\Desktop\AndroidStorm.apk')
desired_caps['appPackage'] = 'com.storm.smart'
desired_caps['appActivity'] = '.LogoActivity'

driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)

上面是代码,就写了这么多,然后 python XXX.py 运行,appium 上报错信息;

error: Failed to start an Appium session, err was: Error: Command failed:
debug: Error: Command failed:
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
debug: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: )","killed":false,"code":1,"signal":null,"origValue":"Command failed: "},"sessionId":null}

不知道这个 Command failed 是怎么错了。求大神指点。


↙↙↙阅读原文可查看相关链接,并与作者交流