Appium ios 报 error:Log capture did not start in a reasonable amount of time

wq · 2015年04月20日 · 最后由 陈恒捷 回复于 2015年04月21日 · 1147 次阅读

我想在真机上做测试运行报错:
warn: Could not parse app Localizable.strings assuming it doesn't exist
error: Log capture did not start in a reasonable amount of time
error: Failed to start an Appium session, err was: Error: Log capture did not start in a reasonable amount of time

error: Could not initialize ideviceinstaller; make sure it is installed and works on your system

配置:
手机:4s 版本 IOS7.0.6
XCODE:6.2
appium:1.3.7
os x:10.10.2
语言:Python

包是提前 profile 到机器上去的

代码
class SimpleIOSTests(unittest.TestCase):

def setUp(self):
# set up appium
self.driver = webdriver.Remote(
command_executor='http://127.0.0.1:4723/wd/hub',
desired_capabilities={
'deviceName':'',
'platformName': 'iOS',
'app': 'com.u17.www',
'udid':'209219C37E29A8A6A565294E046EFAF85AA131A3'
})

def tearDown(self):
self.driver.quit()

============error ===============================
warn: Could not parse app Localizable.strings assuming it doesn't exist
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/u17/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/u17/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Reusing dynamic bootstrap: /Users/u17/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.2","iOSSDKVersion":"8.2","deviceName":"","platformVersion":"8.1"}
info: [debug] fixDevice is on
info: [debug] Fixing device. Changed from: "iPhone Simulator (8.1 Simulator)" to: "iPhone 6 (8.1 Simulator)"
info: [debug] Final device string is: 'iPhone 6 (8.1 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons

info: [debug] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole

error: Log capture did not start in a reasonable amount of time

info: [debug] Cleaning up appium session

error: Failed to start an Appium session, err was: Error: Log capture did not start in a reasonable amount of time

info: [debug] Error: Log capture did not start in a reasonable amount of time
at null._onTimeout (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-log.js:137:10)
at Timer.listOnTimeout (timers.js:110:15)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Log capture did not start in a reasonable amount of time)","origValue":"Log capture did not start in a reasonable amount of time"},"sessionId":null}
info: <-- POST /wd/hub/session 500 10126.270 ms - 234
info: [debug] Not pre-launching simulator
info: [debug] Creating iDevice object with udid 209219C37E29A8A6A565294E046EFAF85AA131A3
info: [debug] Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller

error: Could not initialize ideviceinstaller; make sure it is installed and works on your system

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 0.995 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}

求大神帮忙!

共收到 7 条回复 时间 点赞
wq #1 · 2015年04月20日 Author

顶上去

  1. 请加头像及把文章按照页面底部的格式要求排版(代码请贴代码并使用代码块!日志请贴日志并使用代码块!)
  2. 解决方案就是装 ideviceinstaller :brew install ideviceinstaller。appium.app build-in 的貌似是那个用不了的。不知道什么是 brew 的请搜索 homebrew
wq #3 · 2015年04月21日 Author

@chenhengjie123 第一次提问下次下次一定注意,头像晚上照个好看点的照片再传! 我按照你说的装了 ideviceinstaller 仍然报这个错! 请问还有其他的解决方案吗?

装了之后重启了 appium server 了吗?
正常来说装了之后应该就没问题了。即使有问题,也不会是同一个问题。

#3 楼 @wangquan2596489 好吧,刚才细看了一下你的 log,问题不止 ideviceinstaller :

info: [debug] Starting iOS device log capture via deviceconsole

error: Log capture did not start in a reasonable amount of time

info: [debug] Cleaning up appium session

error: Failed to start an Appium session, err was: Error: Log capture did not start in a reasonable amount of time

info: [debug] Error: Log capture did not start in a reasonable amount of time
at null._onTimeout (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-log.js:137:10)
at Timer.listOnTimeout (timers.js:110:15)

你把 deviceName 补充上去吧。具体要用什么 deviceName 参照 https://github.com/appium/appium/blob/master/docs/cn/writing-running-appium/caps.cn.md

wq #6 · 2015年04月21日 Author

@chenhengjie123 感谢! ok 了重装了 ideviceinstaller 修改了 deviceName 重启就 OK 了
感谢你和群里兄弟们的帮助±!

#6 楼 @wangquan2596489 麻烦更新一下标题并把尽量详细的解决方案附到正文中,方便后面的人查看。谢谢!

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册