Python 无法让appium启动iPhone模拟器
我编写了一个简单的python脚本:Python 无法让appium启动iPhone模拟器,python,selenium,appium,Python,Selenium,Appium,我编写了一个简单的python脚本: from appium import web driver import unittest desired_caps = {} desired_caps['platformName'] = 'iOS' desired_caps['platformVersion'] = '7.1' desired_caps['deviceName'] = 'iPhone Simulator' desired_caps['browserName'] = 'safari' d
from appium import web driver
import unittest
desired_caps = {}
desired_caps['platformName'] = 'iOS'
desired_caps['platformVersion'] = '7.1'
desired_caps['deviceName'] = 'iPhone Simulator'
desired_caps['browserName'] = 'safari'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
driver.get("www.google.com")
但当我执行脚本时,它得到了以下错误日志:
Traceback (most recent call last):
File "iOSTest.py", line 10, in <module>
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
File "/Library/Python/2.7/site-packages/appium/webdriver/webdriver.py", line 35, in __init__
super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 73, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 121, in start_session
'desiredCapabilities': desired_capabilities,
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 166, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: u"A new session could not be created. (Original error: ENOENT, stat '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/Applications')"
回溯(最近一次呼叫最后一次):
文件“iOSTest.py”,第10行,在
driver=webdriver.Remote('http://localhost:4723/wd/hub,所需的(大写)
文件“/Library/Python/2.7/site packages/appium/webdriver/webdriver.py”,第35行,在__
超级(WebDriver,self)。\uuuuu init\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
文件“/Library/Python/2.7/site packages/selenium/webdriver/remote/webdriver.py”,第73行,在__
self.start\u会话(所需的\u功能、浏览器\u配置文件)
文件“/Library/Python/2.7/site packages/selenium/webdriver/remote/webdriver.py”,第121行,在启动会话中
“desiredCapabilities”:所需的功能,
文件“/Library/Python/2.7/site packages/selenium/webdriver/remote/webdriver.py”,执行中的第173行
self.error\u handler.check\u响应(响应)
文件“/Library/Python/2.7/site packages/selenium/webdriver/remote/errorhandler.py”,第166行,在check\u响应中
引发异常类(消息、屏幕、堆栈跟踪)
selenium.common.exceptions.WebDriverException:Message:u“无法创建新会话。(原始错误:enoint,stat'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/sdk/iPhoneSimulator7.1.sdk/Applications”)
我的应用程序版本是:1.2.2
配置包括:
服务器地址:127.0.0.1端口:4723
有人能帮忙吗
谢谢,它找不到模拟器了。您使用的是什么版本的Xcode 你能到下面的目录吗?里面有7.1模拟器吗
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
你可能已经有一个模拟程序在运行了吗。没有模拟器正在运行。错误消息显示
原始错误:enoint
。这是操作系统找不到文件时出现的错误。发生这种情况的一个常见原因是,如果您告诉应用程序查找其文件时出错。失败的路径在错误消息中。致路易斯:谢谢。我再看一看。我不知道Appium不支持Xcode 6,谢谢。我再试试。非常感谢你。我看了一下这个文件夹。问题是我不知何故使用了7.0模拟器而不是7.1。问题解决了。