Appium win7 上用 Python 调用 shell 启动 appium 失败

ling · December 30, 2016 · Last by ling replied at January 03, 2017 · Last modified by admin 恒温 · 1474 hits

参考 的命令在Python中启动appium

import com
import verification_code
import subprocess
cmd ="start /b appium -a -p 4723 --session-override --command-timeout 600"
p = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)

PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(__file__), p)
desired_caps = {}
desired_caps['platformName'] ='Android'
desired_caps['platformVersion'] ='4.4.4'
desired_caps['deviceName'] = '01b70616'
desired_caps['appPackage'] ='com.kdweibo.client'
desired_caps['appActivity'] = '' #主界面Activity
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)


C:\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.1\helpers\pydev\" --multiproc --qt-support --client --port 61805 --file C:/Users/Administrator/PycharmProjects/KDsign_app/test/
pydev debugger: process 91048 is connecting

Connected to pydev debugger (build 143.595)
<subprocess.Popen object at 0x038C6470>
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.1\helpers\pydev\", line 2403, in <module>
globals =['file'], None, None, is_module)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.1\helpers\pydev\", line 1794, in run
launch(file, globals, locals) # execute the script
File "C:/Users/Administrator/PycharmProjects/KDsign_app/test/", line 4, in <module>
from commond import SignOutside,SignInside
File "C:\Users\Administrator\PycharmProjects\KDsign_app\commond\", line 2, in <module>
from basic import SetUp
File "C:\Users\Administrator\PycharmProjects\KDsign_app\commond\", line 24, in <module>
class SetUp():
File "C:\Users\Administrator\PycharmProjects\KDsign_app\commond\", line 31, in SetUp
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
File "build\bdist.win32\egg\appium\webdriver\", line 37, in __init__
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\", line 74, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\", line 123, in start_session
'desiredCapabilities': desired_capabilities,
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\", line 173, in execute
response = self.command_executor.execute(driver_command, params)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\", line 349, in execute
return self._request(command_info[0], url, body=data)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\", line 417, in _request
resp =
File "C:\Python27\lib\", line 431, in open
response = self._open(req, data)
File "C:\Python27\lib\", line 449, in _open
'_open', req)
File "C:\Python27\lib\", line 409, in _call_chain
result = func(*args)
File "C:\Python27\lib\", line 1227, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 10061] >
共收到 1 条回复 时间 点赞
恒温 内容不符合版规屏蔽此话题 30 Dec 12:20
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up