• 我查看 adb.js 连这个方法都没找到 不晓得是怎么回事呢

  • @xiguamaomaoqiu @Sandu1213 😷 我放弃了。。。换成了 appium-ios-inspector
    因为到最后都没解决

  • WebDriverAgent 简介 at 2017年02月07日

    #43 楼 @chenhengjie123 没解决。。。换成 appium-ios-inspector 了。。。

  • 至今 macaca app-inspector 运行有问题的在这里~

  • iOS 真机如何获取元素呢

  • 是按照这个上面来的

  • 安装 app-inspector 的时候,build inspector 老是失败

  • @u1449475793 我知道了,我安装 app-inspector 的时候 build inspector 是失败的
    一直没成功过 不知道是什么原因

  • 不是, 是把 macaca 相关的都卸载了,重新装了一遍

  • @ u1449475793 我卸载了重装有又重新修改文件并 build 也成功了,但还是报这个错😭

  • 试过了, 两个文件的 bundle id 都修改过, 也 build 成功了。而且每次实验之前都是把之前的版本卸载掉的

  • @u1449475793 我运行 app-inspector -u [udid] --verbose, 报的是其他错貌似:

    server.js:16:12 [master] pid:12516 server start with config:
    { port: 5678,
    verbose: true,
    udid: 'bb1f6c5abfef652ef6b087f434acb8de105b90d4',
    ip: '10.48.18.78',
    host: 'cd-yh-huangqin.local',
    loaded_time: '2017-01-13 17:54:29' }
    app-inspector.js:42:10 [master] pid:12516 server start at: http://10.48.18.78:5678
    xctest-client.js:56:14 [master] pid:12516 project path: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
    xctest-client start with port: 8900
    xctest-client.js:233:14 [master] pid:12516 xcode version: 8.2.1
    WebDriverAgent version: 1.0.41
    xctest-client.js:170:14 [master] pid:12516 2017-01-13 17:54:31.047 xcodebuild[12522:404331] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
    /Users/beyondsoft/Library/Developer/Xcode/DerivedData/WebDriverAgent-ceakatlydgitcjebccsbdhchgrpn/Logs/Test/94DA19C9-9472-41C1-BFF2-2E553C43A88D/Session-WebDriverAgentRunner-2017-01-13_175431-gxDQSv.log
    2017-01-13 17:54:31.047 xcodebuild[12522:404330] [MT] IDETestOperationsObserverDebug: (718F959D-5B1B-47D4-9C49-E75A060790A6) Beginning test session WebDriverAgentRunner-718F959D-5B1B-47D4-9C49-E75A060790A6 at 2017-01-13 17:54:31.046 with Xcode 8C1002 on target {
    deviceSerialNumber: F2PLDGB3FQ0Y
    identifier: bb1f6c5abfef652ef6b087f434acb8de105b90d4
    deviceClass: iPhone
    deviceName: iPhone
    deviceIdentifier: bb1f6c5abfef652ef6b087f434acb8de105b90d4
    productVersion: 10.0.1
    buildVersion: 14A403
    deviceSoftwareVersion: 10.0.1 (14A403)
    deviceArchitecture: armv7s
    deviceTotalCapacity: 13092655104
    deviceAvailableCapacity: 8088752128
    deviceIsTransient: NO
    ignored: NO
    deviceIsBusy: NO
    deviceIsActivated: YES
    deviceActivationState: Activated
    deviceType:
    supportedDeviceFamilies: (
    1
    )
    applications: (null)
    provisioningProfiles: (null)
    activityProgress: -2
    activityTitle:

    hasInternalSupport: NO
    isSupportedOS: YES
    developerDiskMountError: (null)
    (null)
    } (10.0.1 (14A403))

    xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
    xctest-client.js:170:14 [master] pid:12516 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/sv/0x5js8lj6k1gbk3gv45k171w0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/d40c6571a14c026f3c9845448b045354/bb1f6c5abfef652ef6b087f434acb8de105b90d4/ManifestCache.plist

    xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
    xctest-client.js:170:14 [master] pid:12516 2017-01-13 17:54:50.908 xcodebuild[12522:404330] Error Domain=com.apple.dtdevicekit Code=-402652994 "App installation failed" UserInfo={NSLocalizedFailureReason=This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed., com.apple.dtdevicekit.stacktrace=(
    0 DTDeviceKitBase 0x000000010bf0137b DTDKCreateNSError + 113
    1 DTDeviceKitBase 0x000000010bf01ab9 DTDK_AMDErrorToNSError + 791
    2 DTDeviceKitBase 0x000000010bf419df __90-[DTDKRemoteDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 158
    3 DVTFoundation 0x000000010310e989 DVTInvokeWithStrongOwnership + 75
    4 DTDeviceKitBase 0x000000010bf41725 -[DTDKRemoteDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1181
    5 IDEiOSSupportCore 0x000000010be37e1f __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.336 + 4597
    6 DVTFoundation 0x0000000103232cb7 __DVTDispatchAsync_block_invoke + 827
    7 libdispatch.dylib 0x00007fffd29b3f5f _dispatch_call_block_and_release + 12
    8 libdispatch.dylib 0x00007fffd29ab128 _dispatch_client_callout + 8
    9 libdispatch.dylib 0x00007fffd29c1b97 _dispatch_queue_serial_drain + 896
    10 libdispatch.dylib 0x00007fffd29b3d41 _dispatch_queue_invoke + 1046
    11 libdispatch.dylib 0x00007fffd29acee0 _dispatch_root_queue_drain + 476
    12 libdispatch.dylib 0x00007fffd29accb7 _dispatch_worker_thread3 + 99
    13 libsystem_pthread.dylib 0x00007fffd2bf8736 _pthread_wqthread + 1299
    14 libsystem_pthread.dylib 0x00007fffd2bf8211 start_wqthread + 13
    ), NSLocalizedRecoverySuggestion=This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed., NSLocalizedDescription=App installation failed}
    2017-01-13 17:54:50.908 xcodebuild[12522:404330] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

    xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
    xctest-client.js:170:14 [master] pid:12516
    Testing failed:

    xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
    xctest-client.js:170:14 [master] pid:12516 Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
    ** TEST FAILED **

    xctest-client.js:171:14 [master] pid:12516 please check project: /usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
    xctest-client.js:267:14 [master] pid:12516 killing deviceLogProc pid: 12519
    xctest-client.js:272:14 [master] pid:12516 killing runnerProc pid: 12522
    xctest-client.js:278:14 [master] pid:12516 killing iproxyProc pid: 12521
    xctest-client.js:181:14 [master] pid:12516 xctest client exit with code: 65, signal: null
    xctest-client.js:145:16 [master] pid:12516 deviceconsole exit with code: null, signal: SIGKILL
    xctest-client.js:255:14 [master] pid:12516 Fail to start xctest: undefined
    app-inspector:66:44 [master] pid:12516 undefined
    (node:12516) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: >> app-inspector:66:44 [master] pid:12516 undefined
    (node:12516) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    xctest-client.js:209:14 [master] pid:12516 iproxy exit with code: null, signal: SIGKILL

  • @harsayer 用的 iOS 真机,启动:app-inspector -u bb1f6c5abfef652ef6b087f434acb8de105b90d4,报错:

    xctest-client start with port: 8900
    WebDriverAgent version: 1.0.41
    app-inspector:66:44 [master] pid:10034 undefined
    (node:10034) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: >> app-inspector:66:44 [master] pid:10034 undefined
    (node:10034) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    不知道是哪里出错了,求助~

  • @wanwan001 解决了嘛

  • WebDriverAgent 简介 at 2017年01月13日

    之前的问题已解决,可是无法像楼主你们这样打开 inspector, 直接获取图像化的元素读取, 请问这个怎么实现的

  • WebDriverAgent 简介 at 2017年01月11日

    @chenhengjie123 code signing 问题现在解决了,但是现在在卡着不动了:
    [XCUITest] Waiting for WebDriverAgent to start on device
    [debug] [XCUITest] Log file for xcodebuild test: /Users/beyondsoft/Library/Developer/Xcode/DerivedData/WebDriverAgent-cdbymtonqyssjhfwnanxtomfuiox/Logs/Test/CA67A9A7-4B60-42EA-A9E3-604608AA8EFE/Session-WebDriverAgentRunner-2017-01-11_165113-AuhrXW.log
    [Xcode] 2017-01-11 16:51:31.436 xcodebuild[99550:3564048] DTDeviceKit: Could not start house arrest service for app identifier com.apple.test.WebDriverAgentRunner-Runner [Error Domain=com.apple.dtdevicekit Code=-402653093 "Too many instances of this service are already running." UserInfo={NSLocalizedFailureReason=Too many instances of this service are already running., com.apple.dtdevicekit.stacktrace=(
    0 DTDeviceKitBase 0x00000001159fa37b DTDKCreateNSError + 113
    1 DTDeviceKitBase 0x00000001159faab9 DTDK_AMDErrorToNSError + 791
    2 DTDeviceKitBase 0x0000000115a0c2a5 __70-[DTDKRemoteDeviceConnection startHouseArrestServiceForAppIdentifier:]_block_invoke + 100
    3 DTDeviceKitBase 0x0000000115a0b181 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_4 + 22
    4 DTDeviceKitBase 0x00000001159fd2c7 __DTDKExecuteInSession_block_invoke + 38
    5 DTDeviceKitBase 0x00000001159fc8f0 __DTDKExecuteWithConnection_block_invoke_2 + 477
    6 DTDeviceKitBase 0x00000001159fc6ec __DTDKExecuteWithConnection_block_invoke + 107
    7 libdispatch.dylib 0x00007fffda0c6128 _dispatch_client_callout + 8
    8 libdispatch.dylib 0x00007fffda0c6d62 _dispatch_barrier_sync_f_invoke + 83
    9 DVTFoundation 0x000000010e62695b DVTDispatchBarrierSync + 206
    10 DVTFoundation 0x000000010e603307 -[DVTDispatchLock performLockedBlock:] + 116
    11 DTDeviceKitBase 0x00000001159fc5f6 DTDKExecuteWithConnection + 223
    12 DTDeviceKitBase 0x00000001159fd251 DTDKExecuteInSession + 121
    13 DTDeviceKitBase 0x0000000115a0b0b8 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 117
    14 DVTFoundation 0x000000010e625cb7 __DVTDispatchAsync_block_invoke + 827
    15 libdispatch.dylib 0x00007fffda0cef5f _dispatch_call_block_and_release + 12
    16 libdispatch.dylib 0x00007fffda0c6128 _dispatch_client_callout + 8
    17 libdispatch.dylib 0x00007fffda0dbc10 _dispatch_continuation_pop + 533
    18 libdispatch.dylib 0x00007fffda0d2ea3 _dispatch_async_redirect_invoke + 734
    19 libdispatch.dylib 0x00007fffda0c7ee0 _dispatch_root_queue_drain + 476
    20 libdispatch.dylib 0x00007fffda0c7cb7 _dispatch_worker_thread3 + 99
    21 libsystem_pthread.dylib 0x00007fffda313736 _pthread_wqthread + 1299
    22 libsystem_pthread.dylib 0x00007fffda313211 start_wqthread + 13
    ), NSLocalizedRecoverySuggestion=Too many instances of this service are already running., NSLocalizedDescription=Too many instances of this service are already running.}]

    [debug] [WebDriverAgent] Device: Jan 11 16:51:39 iPhone XCTRunner[322] : Running tests...
    [debug] [WebDriverAgent] Device: Jan 11 16:51:39 iPhone XCTRunner[322] : Unable to load configuration data from specified path /var/folders/sv/0x5js8lj6k1gbk3gv45k171w0000gn/T/com.apple.dt.XCTest/B4AF29A1-6DE6-48A3-9EB4-C84C4493A9B1/remote-container/tmp/WebDriverAgentRunner-B4AF29A1-6DE6-48A3-9EB4-C84C4493A9B1.xctestconfiguration; error: The file doesn\M-b\M@\MYt exist.
    [debug] [WebDriverAgent] Device: Jan 11 16:51:39 iPhone XCTRunner[322] : Looking for test bundles in /var/containers/Bundle/Application/BCEA1CC9-2093-4494-98FF-B8957B96FE19/WebDriverAgentRunner-Runner.app/PlugIns
    [debug] [WebDriverAgent] Device: Jan 11 16:51:39 iPhone XCTRunner[322] : Found test bundle at /var/containers/Bundle/Application/BCEA1CC9-2093-4494-98FF-B8957B96FE19/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest
    [debug] [WebDriverAgent] Device: Jan 11 16:51:39 iPhone XCTRunner[322] : Looking for configurations in /var/containers/Bundle/Application/BCEA1CC9-2093-4494-98FF-B8957B96FE19/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest
    [debug] [WebDriverAgent] Device: Jan 11 16:51:39 iPhone XCTRunner[322] : No configurations found, creating a default configuration that will run all tests.
    然后就一直卡在这里- -

  • WebDriverAgent 简介 at 2017年01月10日

    @chenhengjie123 error:
    [Xcode]
    Testing failed:
    Signing for "WebDriverAgentRunner" requires a development team. Select a development team in the project editor.

    [Xcode] Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.2'
    TEST FAILED

    The following build commands failed:
    Check dependencies
    (1 failure)
    .....
    主要错就在这里

  • WebDriverAgent 简介 at 2017年01月09日

    @chenhengjie123 真机装不上 WebDriverAgent 呢,是签名问题么?试了好几个 id 都不行呢

  • 用 Xcode8.2 的模拟器安装的 app 一启动就 crash 真机上同样的 app 又是好的😓

  • @luobs 顶, 解决了么

  • WebDriverAgent 简介 at 2016年12月27日

    我用 Xcode 模拟器安装.app 文件时, 会自动安装 webdriveragent, app 也能被安装上 但是一点开就 crash 不知道为什么
    真机测试就完全启动不了 Unable to start WebDriverAgent

  • 已解决。。。是我装错了 app

  • WebDriverAgent 简介 at 2016年12月27日

    求助~我在安装的时候,最后报错:
    Fetching dependencies
    Building Inspector
    Creating bundle directory...
    Fetching Inspector dependencies...
    npm WARN react-treeview@0.4.6 requires a peer of react@>=0.14.0 but none was installed.
    npm WARN web-driver-inspector@1.0.0 No repository field.
    Building Inspector...

    web-driver-inspector@1.0.0 build /node_modules/webdriver/WebDriverAgent/Inspector
    webpack --progress --colors

    Hash: 9ed7d0b85cc08341fd0f

    Version: webpack 1.14.0
    Time: 74ms
    [0] multi main 28 bytes {0} [built] [1 error]
    + 1 hidden modules

    ERROR in ./js/app.js
    Module parse failed: /node_modules/webdriver/WebDriverAgent/Inspector/js/app.js Unexpected token (59:4)
    You may need an appropriate loader to handle this file type.
    SyntaxError: Unexpected token (59:4)
    at Parser.pp$4.raise (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp.unexpected (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1597:21)
    at Parser.pp$3.parseParenAndDistinguishExpression (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1861:32)
    at Parser.pp$3.parseExprAtom (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1796:19)
    at Parser.pp$3.parseExprSubscripts (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1597:21)
    at Parser.pp$3.parseExpression (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1573:21)
    at Parser.pp$1.parseReturnStatement (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:839:33)
    at Parser.pp$1.parseStatement (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:699:34)
    at Parser.pp$1.parseBlock (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:981:25)
    at Parser.pp$3.parseFunctionBody (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:2105:24)
    at Parser.pp$3.parseMethod (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:2075:10)
    at Parser.pp$1.parseClassMethod (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1137:25)
    at Parser.pp$1.parseClass (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:1118:14)
    at Parser.pp$1.parseStatement (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:697:19)
    at Parser.pp$1.parseTopLevel (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:638:25)
    at Parser.parse (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:516:17)
    at Object.parse (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/acorn/dist/acorn.js:3098:39)
    at Parser.parse (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/webpack/lib/Parser.js:902:15)
    at NormalModule. (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/webpack/lib/NormalModule.js:104:16)
    at NormalModule.onModuleBuild (/node_modules/webdriver/WebDriverAgent/Inspector/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
    @ multi main
    Done

  • #86 楼 @Lihuazhang iOS 请忽略 adb devices

  • 报: Could not connect to lockdownd. Exiting.
    sudo chmod -R 777 /var/db/lockdown/ 无法解决