• 我用了很久的 appium 之后,今天才回头来仔细看 appium 的实现原理,可能有点本末倒置了,但是看到你对 bootstrap 解释的这么清楚,我还是很佩服的。

  • WebDriverAgent 简介 at August 03, 2016

    #29 楼 @lihuazhang 你好,webdriveragent 上面有一张图简单原理,我想请教的是,XCTest.framework/Uiautomation.framework,关于这里我有一点疑问,我在 wda 源码里貌似没有看到跟 uiautomation 相关的地方,wda 也是封装了 uiautomation 的吗?我理解的是 wda 采用的是 XCUITesting,应该跟 uiautomation 无关是吗?不知道我是理解的不对还是怎么样,希望您能给点指教。谢谢

  • 达峰棒棒哒

  • 你好,我也出现了同样的错误,已经更改了 bundle Identifier,仍然报错,test failed

  • #14 楼 @chenhengjie123 我跟新了代码,build succeeded,然后总是提示 test failed,会有提示:

    2016-07-22 15:02:15.057 XCTRunner[5303:2236022] Running tests...
    2016-07-22 15:02:15.264 XCTRunner[5303:2236022] The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
    2016-07-22 15:02:15.264 XCTRunner[5303:2236022] (dlopen_preflight(/var/containers/Bundle/Application/AE743399-C99B-484A-BB52-A2D71317591B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner): Library not loaded: @rpath/KissXML.framework/KissXML
      Referenced from: /private/var/containers/Bundle/Application/AE743399-C99B-484A-BB52-A2D71317591B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
      Reason: no suitable image found.  Did find:
        /private/var/containers/Bundle/Application/AE743399-C99B-484A-BB52-A2D71317591B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/AE743399-C99B-484A-BB52-A2D71317591B/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML')
    

    能指导一下吗?更新代码前,是可以正常使用的,能打开 inspector 查看控件定位。

  • WebDriverAgent 踩坑记 at July 22, 2016

    #47 楼 @codeskyblue 各种方式联系你,联系不到你啊,可否加一下 qq 呢?872489864,给你还发了邮件。。。。。

  • #12 楼 @quqing 你好 ,在用 appium 或者直接用 uiautomation 执行 UI 功能测试的时候,结果文件中有.instrumentscli.trace 文件,你提到已经解决解析 trace 文件方案,是怎么解析 trace 的呢?能否指导一下呢?

  • #9 楼 @chenhengjie123 我直接在 instruments 界面下,输入

    var target = UIATarget.localTarget();
    var app = target.frontMostApp();  
    var window = app.mainWindow(); 
    target.logElementTree();
    

    是可以打印出来的

  • #2 楼 @dippa 我也是之前用 appium 好好的,现在遇到一个无法绕过的问题,现在转移用 tuneup_js,封装的 uiautomation 上手挺快的,就是定位很麻烦,看定位信息特别烦

  • 关闭 show Simulator Log 和 Show iOS System Log 日志

    info: [debug] App is an iOS bundle, will attempt to run as pre-existing
    info: [debug] Creating new appium session 0509b98b-adc7-40ac-9a6c-96a751b5e199
    info: [debug] Removing any remaining instruments sockets
    info: [debug] Cleaned up instruments socket /tmp/instruments_sock
    info: [debug] Auto-detecting iOS udid...
    info: [debug] Not auto-detecting udid, running on sim
    info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    info: Will try to parse the plist file as XML
    info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    warn: Could not parse app Localizable.strings assuming it doesn't exist
    info: [debug] Creating instruments
    
    info: [debug] Preparing uiauto bootstrap
    info: [debug] Dynamic bootstrap dir: /Users/djx/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/submodules/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/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    
    info: [debug] Reusing dynamic bootstrap: /Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
    
    info: [debug] Creating iDevice object with udid 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] App is installed.
    
    info: [debug] fullReset not requested. No need to install.
    info: [debug] Starting command proxy.
    
    info: [debug] Instruments socket server started at /tmp/instruments_sock
    info: [debug] Starting instruments
    
    info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
    
    info: Launching instruments
    
    info: [debug] Attempting to run app on real device with UDID 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5d2d323666d505449e9a67cbd3fccc8ff80baadf HM.wristband2 -e UIASCRIPT "/Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js" -e UIARESULTSPATH /tmp/appium-instruments
    info: [debug] And extra without-delay env: {}
    
    info: [debug] And launch timeouts (in ms): {"global":90000}
    
    info: [debug] [INST STDERR] 2016-06-07 16:07:04.206 instruments[6594:714644] WebKit Threading Violation - initial use of WebKit from a secondary thread.
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 1.612 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.226 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: Instruments is ready to receive commands
    
    info: [debug] Instruments launched. Starting poll loop for new commands.
    info: [debug] Setting bootstrap config keys/values
    info: [debug] Pushing command to appium work queue: "target = $.target();\nau = $;\n$.isVerbose = true;\n"
    
    info: [debug] Socket data received (2 bytes)
    info: [debug] Socket data being routed.
    info: [debug] Sending command to instruments: target = $.target();
    au = $;
    $.isVerbose = true;
    
    
    info: [debug] Socket data received (27 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":true}
    
    info: [debug] Setting initial orientation to PORTRAIT
    info: [debug] Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
    info: [debug] Sending command to instruments: au.setScreenOrientation('PORTRAIT')
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: Running system command #1: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":true}...
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: evaluating au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: target.setDeviceOrientation("1")
    
    info: [debug] Socket data received (33 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":"PORTRAIT"}
    info: [debug] Waiting for app source to contain elements
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: Running system command #2: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":"PORTRAIT"}...
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: [debug] Socket data received (208 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":false,"valid":false,"visible":false,"hint":null,"path":"/0","x":0,"y":0,"width":0,"height":0},">":[]}}}
    info: [debug] Waited for 4045ms so far
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: evaluation finished
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: responding with:
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: Running system command #3: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled...
    
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:25 +0000 Debug: Got new command 3 from instruments: au.mainApp().getTreeForXML()
           2016-06-07 08:07:25 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 3.208 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.244 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- POST /wd/hub/session - - ms - - 
    
    undefined
    
    

    #2 楼 @chenhengjie123

  • 关闭 show Simulator Log 和 Show iOS System Log 日志

    info: [debug] App is an iOS bundle, will attempt to run as pre-existing
    info: [debug] Creating new appium session 0509b98b-adc7-40ac-9a6c-96a751b5e199
    info: [debug] Removing any remaining instruments sockets
    info: [debug] Cleaned up instruments socket /tmp/instruments_sock
    info: [debug] Auto-detecting iOS udid...
    info: [debug] Not auto-detecting udid, running on sim
    info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    info: Will try to parse the plist file as XML
    info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    warn: Could not parse app Localizable.strings assuming it doesn't exist
    info: [debug] Creating instruments
    
    info: [debug] Preparing uiauto bootstrap
    info: [debug] Dynamic bootstrap dir: /Users/djx/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/submodules/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/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    
    info: [debug] Reusing dynamic bootstrap: /Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
    
    info: [debug] Creating iDevice object with udid 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] App is installed.
    
    info: [debug] fullReset not requested. No need to install.
    info: [debug] Starting command proxy.
    
    info: [debug] Instruments socket server started at /tmp/instruments_sock
    info: [debug] Starting instruments
    
    info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
    
    info: Launching instruments
    
    info: [debug] Attempting to run app on real device with UDID 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5d2d323666d505449e9a67cbd3fccc8ff80baadf HM.wristband2 -e UIASCRIPT "/Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js" -e UIARESULTSPATH /tmp/appium-instruments
    info: [debug] And extra without-delay env: {}
    
    info: [debug] And launch timeouts (in ms): {"global":90000}
    
    info: [debug] [INST STDERR] 2016-06-07 16:07:04.206 instruments[6594:714644] WebKit Threading Violation - initial use of WebKit from a secondary thread.
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 1.612 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.226 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: Instruments is ready to receive commands
    
    info: [debug] Instruments launched. Starting poll loop for new commands.
    info: [debug] Setting bootstrap config keys/values
    info: [debug] Pushing command to appium work queue: "target = $.target();\nau = $;\n$.isVerbose = true;\n"
    
    info: [debug] Socket data received (2 bytes)
    info: [debug] Socket data being routed.
    info: [debug] Sending command to instruments: target = $.target();
    au = $;
    $.isVerbose = true;
    
    
    info: [debug] Socket data received (27 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":true}
    
    info: [debug] Setting initial orientation to PORTRAIT
    info: [debug] Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
    info: [debug] Sending command to instruments: au.setScreenOrientation('PORTRAIT')
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: Running system command #1: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":true}...
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: evaluating au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: target.setDeviceOrientation("1")
    
    info: [debug] Socket data received (33 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":"PORTRAIT"}
    info: [debug] Waiting for app source to contain elements
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: Running system command #2: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":"PORTRAIT"}...
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: [debug] Socket data received (208 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":false,"valid":false,"visible":false,"hint":null,"path":"/0","x":0,"y":0,"width":0,"height":0},">":[]}}}
    info: [debug] Waited for 4045ms so far
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: evaluation finished
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: responding with:
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: Running system command #3: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled...
    
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:25 +0000 Debug: Got new command 3 from instruments: au.mainApp().getTreeForXML()
           2016-06-07 08:07:25 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 3.208 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.244 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- POST /wd/hub/session - - ms - - 
    
    undefined
    
    
  • #2 楼 @chenhengjie123
    关闭 show Simulator Log 和 Show iOS System Log 日志

    info: [debug] App is an iOS bundle, will attempt to run as pre-existing
    info: [debug] Creating new appium session 0509b98b-adc7-40ac-9a6c-96a751b5e199
    info: [debug] Removing any remaining instruments sockets
    info: [debug] Cleaned up instruments socket /tmp/instruments_sock
    info: [debug] Auto-detecting iOS udid...
    info: [debug] Not auto-detecting udid, running on sim
    info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    info: Will try to parse the plist file as XML
    info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    warn: Could not parse app Localizable.strings assuming it doesn't exist
    info: [debug] Creating instruments
    
    info: [debug] Preparing uiauto bootstrap
    info: [debug] Dynamic bootstrap dir: /Users/djx/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/submodules/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/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    
    info: [debug] Reusing dynamic bootstrap: /Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
    
    info: [debug] Creating iDevice object with udid 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] App is installed.
    
    info: [debug] fullReset not requested. No need to install.
    info: [debug] Starting command proxy.
    
    info: [debug] Instruments socket server started at /tmp/instruments_sock
    info: [debug] Starting instruments
    
    info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
    
    info: Launching instruments
    
    info: [debug] Attempting to run app on real device with UDID 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5d2d323666d505449e9a67cbd3fccc8ff80baadf HM.wristband2 -e UIASCRIPT "/Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js" -e UIARESULTSPATH /tmp/appium-instruments
    info: [debug] And extra without-delay env: {}
    
    info: [debug] And launch timeouts (in ms): {"global":90000}
    
    info: [debug] [INST STDERR] 2016-06-07 16:07:04.206 instruments[6594:714644] WebKit Threading Violation - initial use of WebKit from a secondary thread.
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 1.612 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.226 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: Instruments is ready to receive commands
    
    info: [debug] Instruments launched. Starting poll loop for new commands.
    info: [debug] Setting bootstrap config keys/values
    info: [debug] Pushing command to appium work queue: "target = $.target();\nau = $;\n$.isVerbose = true;\n"
    
    info: [debug] Socket data received (2 bytes)
    info: [debug] Socket data being routed.
    info: [debug] Sending command to instruments: target = $.target();
    au = $;
    $.isVerbose = true;
    
    
    info: [debug] Socket data received (27 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":true}
    
    info: [debug] Setting initial orientation to PORTRAIT
    info: [debug] Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
    info: [debug] Sending command to instruments: au.setScreenOrientation('PORTRAIT')
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: Running system command #1: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":true}...
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: evaluating au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: target.setDeviceOrientation("1")
    
    info: [debug] Socket data received (33 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":"PORTRAIT"}
    info: [debug] Waiting for app source to contain elements
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: Running system command #2: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":"PORTRAIT"}...
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: [debug] Socket data received (208 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":false,"valid":false,"visible":false,"hint":null,"path":"/0","x":0,"y":0,"width":0,"height":0},">":[]}}}
    info: [debug] Waited for 4045ms so far
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: evaluation finished
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: responding with:
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: Running system command #3: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled...
    
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:25 +0000 Debug: Got new command 3 from instruments: au.mainApp().getTreeForXML()
           2016-06-07 08:07:25 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 3.208 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.244 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- POST /wd/hub/session - - ms - - 
    
    undefined
    
    
  • #2 楼 @chenhengjie123
    关闭 show Simulator Log 和 Show iOS System Log 日志

    info: [debug] App is an iOS bundle, will attempt to run as pre-existing
    info: [debug] Creating new appium session 0509b98b-adc7-40ac-9a6c-96a751b5e199
    info: [debug] Removing any remaining instruments sockets
    info: [debug] Cleaned up instruments socket /tmp/instruments_sock
    info: [debug] Auto-detecting iOS udid...
    info: [debug] Not auto-detecting udid, running on sim
    info: [debug] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    info: Will try to parse the plist file as XML
    info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/HM.wristband2/en.lproj/Localizable.strings
    warn: Could not parse app Localizable.strings assuming it doesn't exist
    info: [debug] Creating instruments
    
    info: [debug] Preparing uiauto bootstrap
    info: [debug] Dynamic bootstrap dir: /Users/djx/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/submodules/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/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    
    info: [debug] Reusing dynamic bootstrap: /Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
    info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
    
    info: [debug] Creating iDevice object with udid 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] App is installed.
    
    info: [debug] fullReset not requested. No need to install.
    info: [debug] Starting command proxy.
    
    info: [debug] Instruments socket server started at /tmp/instruments_sock
    info: [debug] Starting instruments
    
    info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
    
    info: Launching instruments
    
    info: [debug] Attempting to run app on real device with UDID 5d2d323666d505449e9a67cbd3fccc8ff80baadf
    
    info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5d2d323666d505449e9a67cbd3fccc8ff80baadf HM.wristband2 -e UIASCRIPT "/Users/djx/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js" -e UIARESULTSPATH /tmp/appium-instruments
    info: [debug] And extra without-delay env: {}
    
    info: [debug] And launch timeouts (in ms): {"global":90000}
    
    info: [debug] [INST STDERR] 2016-06-07 16:07:04.206 instruments[6594:714644] WebKit Threading Violation - initial use of WebKit from a secondary thread.
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 1.612 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.226 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: Instruments is ready to receive commands
    
    info: [debug] Instruments launched. Starting poll loop for new commands.
    info: [debug] Setting bootstrap config keys/values
    info: [debug] Pushing command to appium work queue: "target = $.target();\nau = $;\n$.isVerbose = true;\n"
    
    info: [debug] Socket data received (2 bytes)
    info: [debug] Socket data being routed.
    info: [debug] Sending command to instruments: target = $.target();
    au = $;
    $.isVerbose = true;
    
    
    info: [debug] Socket data received (27 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":true}
    
    info: [debug] Setting initial orientation to PORTRAIT
    info: [debug] Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"
    info: [debug] Sending command to instruments: au.setScreenOrientation('PORTRAIT')
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:18 +0000 Debug: Running system command #1: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":true}...
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: evaluating au.setScreenOrientation('PORTRAIT')
    
    info: [debug] [INST] 2016-06-07 08:07:19 +0000 Debug: target.setDeviceOrientation("1")
    
    info: [debug] Socket data received (33 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":"PORTRAIT"}
    info: [debug] Waiting for app source to contain elements
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: evaluation finished
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: responding with:
    info: [debug] [INST] 2016-06-07 08:07:20 +0000 Debug: Running system command #2: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":"PORTRAIT"}...
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:21 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: [debug] Socket data received (208 bytes)
    
    info: [debug] Socket data being routed.
    info: [debug] Got result from instruments: {"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled":false,"valid":false,"visible":false,"hint":null,"path":"/0","x":0,"y":0,"width":0,"height":0},">":[]}}}
    info: [debug] Waited for 4045ms so far
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: evaluation finished
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: responding with:
    
    info: [debug] [INST] 2016-06-07 08:07:24 +0000 Debug: Running system command #3: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":{"UIAApplication":{"@":{"name":null,"label":null,"value":null,"dom":null,"enabled...
    
    info: [debug] Pushing command to appium work queue: "au.mainApp().getTreeForXML()"
    
    info: [debug] Sending command to instruments: au.mainApp().getTreeForXML()
    
    info: [debug] [INST] 2016-06-07 08:07:25 +0000 Debug: Got new command 3 from instruments: au.mainApp().getTreeForXML()
           2016-06-07 08:07:25 +0000 Debug: evaluating au.mainApp().getTreeForXML()
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- GET /wd/hub/status 200 3.208 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: --> GET /wd/hub/status {}
    
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    info: <-- GET /wd/hub/status 200 1.244 ms - 179 {"status":0,"value":{"build":{"version":"1.4.13","revision":"c75d8adcb66a75818a542fe1891a34260c21f76a"},"isShuttingDown":false},"sessionId":"0509b98b-adc7-40ac-9a6c-96a751b5e199"}
    
    info: <-- POST /wd/hub/session - - ms - - 
    
    undefined
    
  • #2 楼 @xdf 能否支持 iphone 手机是 9.2 版本以下的?

  • #2 楼 @chenhengjie123 我用的是真机。 明天回公司关掉 重新运行一下 再提供日志,我其实今天发现,在我不登录 app 的时候,就是未登录状态下,我发现 inspector 是能将 查看控件的窗口调起来的,但是如果从未登录状态调起以后,我再输入用户名密码进入 app,这个时候 点击 refresh,我发现,点击 app 就死机了,点击任何控件位置都没有用。

  • @xdf 环境配置好了以后,启动 macaca run --verbose 模拟器多次闪退,并且不断重启,最后能执行成功官方例子。我把我的配置发出来

  • #4 楼 @xdf 你好,我还没有正式去体验 macaca,有一个疑惑想请教,如何定位 ios 应用的元素,还有如何出报告?

  • 小米运动英文界面 at March 29, 2016

    今天开会还讨论了这个问题,再改。

  • 我之前用模拟器 iOS 的时候,swipe 怎么都不管用,而且 log 还没有报错信息,后来升级了 xcode 升到最新 7.1.2 好像,然后 swipe 奇迹的有用了。

  • #8 楼 @b_88 他不是为了跑脚本 是为了启动 inspector

  • #12 楼 @sandman 我是这样取得 adb shell dumpsys meminfo +packagename|grep 不知道是取 native 还是 dalvik,对应这个 dumpsys meminfo -c|grep proc 取得 pss 值是对应 native 还是说是 dalvik 呢?还是说那个都不是?

  • #10 楼 @sandman 你好,想获取 PSS 的值,但是 adb shell procrank 之后,显示 not found procrank,这个 procrank 命令该怎么安装

  • @sandman 你好,我现在尝试使用 python highcharts 想把获取的 cpu 画出折线图,发现 pandas_highcharts 生成的图表路径不知道怎么设置,不知道能否指导一下。QQ 872489864

  • #76 楼 @testly 你好,我在取值 cpu 的时候,用的语句是 top -d 1|grep +PackageName 在你的 top -n 的时候只能获取到一行值。不知道是否有什么区别。希望可以给点指导,谢谢