• 好了👌

  • README 改了,视频不知道用啥工具 TAT

  • 用啥工具录屏啊?我不会弄哦

  • 用 input_text
    另外 caps 参数加上 unicodeKeyboard=true

  • https://github.com/weamylady2/iOS_remote

    Demo 已上传,欢迎大家指点意见。

  • minicap 要这个机制就没办法了,目前我已经把顺序启动写好了,就是时间有点长,刷新网页之后需要 20 秒钟才能用起来。

  • 页面后面的元素能定位的。
    实在不行你就随便点一个屏幕当中的坐标咯

  • 随便点击页面上一个元素就可以了。这个页面就会消失。

  • STF 常见问题列表 at 2017年09月15日

    offline 跟 usb 供电也有关系,搞根好点的数据线,用 usbhub 的话这种问题也比较多。

  • @yxys01 有空加我微信聊聊吧,xiaotao4495,目前已经把 Demo 写出来了,但还是存在很多的问题,尤其是运行的顺序这个有待优化。

  • 多谢,这个顺序是可以。有没有解决的方法?这个顺序启动的话,还是挺慢的。

  • 给位大佬好,我这边已经用 ios-minicap+Jfinal+Tomacat 把屏幕回显做出来了,屏幕监听事件借用了 wdaproxy 项目中的 js。
    今天在调 tap 事件,遇到一个大问题卡住了:
    1,先启动 WebDriverAgent,再启动 ios-minicap,那么在 WDA 的进程会多出一条日志,然后卡死了。感觉是 iOS-minicap 也在某个地方调用了 WDA,后续的 tap 操作就没办法执行。
    2,如果在 ios-minicap 启动之后,再启动 WDA,那么在向 ios-minicap 发起 socket 获取截图,WDA 同样会出现一样的日志,然后卡死。

    WDA 日志如下:

    99-6-88-54:WebDriverAgent waterhuang$ xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=bb7787b7ba9d57bb6f9c84273d22fe3204d1e547' test
    2017-09-14 16:44:46.386 xcodebuild[20603:567818]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
    /Users/waterhuang/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/86F41E4A-F9BF-4585-B2A9-C25DF7D17CCC/Session-WebDriverAgentRunner-2017-09-14_164446-6Y1V40.log
    2017-09-14 16:44:46.387 xcodebuild[20603:567817] [MT] IDETestOperationsObserverDebug: (727C4322-FEB3-4E83-8C45-35F618841E8D) Beginning test session WebDriverAgentRunner-727C4322-FEB3-4E83-8C45-35F618841E8D at 2017-09-14 16:44:46.387 with Xcode 8E3004b on target <DVTiOSDevice: 0x7fe2fcfdb1c0> {
            deviceSerialNumber:         C8QP5BQHG5MP
            identifier:                 bb7787b7ba9d57bb6f9c84273d22fe3204d1e547
            deviceClass:                iPhone
            deviceName:                 iPhone
            deviceIdentifier:           bb7787b7ba9d57bb6f9c84273d22fe3204d1e547
            productVersion:             10.3.3
            buildVersion:               14G60
            deviceSoftwareVersion:      10.3.3 (14G60)
            deviceArchitecture:         arm64
            deviceTotalCapacity:        12241596416
            deviceAvailableCapacity:    8145756160
            deviceIsTransient:          NO
            ignored:                    NO
            deviceIsBusy:               NO
            deviceIsActivated:          YES
            deviceActivationState:      Activated
            isPasscodeLocked:           NO
            deviceType:                 <DVTDeviceType:0x7fe2fcca88c0 Xcode.DeviceType.iPhone>
            supportedDeviceFamilies:    (
        1
    )
            applications:              (null)
            provisioningProfiles:      (null)
            activityProgress:          -2
            activityTitle:             
            hasInternalSupport:        NO
            isSupportedOS:             YES
            developerDiskMountError:   (null)
    (null)
        bootArgs:                  <unavailable>
            } (10.3.3 (14G60))
    === BUILD TARGET WebDriverAgentLib OF PROJECT WebDriverAgent WITH CONFIGURATION Debug ===
    
    Check dependencies
    
    === BUILD TARGET WebDriverAgentRunner OF PROJECT WebDriverAgent WITH CONFIGURATION Debug ===
    
    Check dependencies
    
    MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
    state->old_bundle: /var/folders/lq/q_5j5j1d2d5_v7w4bxmhgv5r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/33d6e04dc03b69e6e6e6fd8dea37958a/bb7787b7ba9d57bb6f9c84273d22fe3204d1e547/WebDriverAgentRunner-Runner.app
    state->new_bundle: /Users/waterhuang/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
    state->dst_bundle: /var/folders/lq/q_5j5j1d2d5_v7w4bxmhgv5r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.NXYEQh/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE
        dst_ipa: /var/folders/lq/q_5j5j1d2d5_v7w4bxmhgv5r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.NXYEQh/WebDriverAgentRunner-Runner.app_sparse.ipa
    MDMDirectoryDiff_block_invoke:1473 calling writeDictToFile with: /var/folders/lq/q_5j5j1d2d5_v7w4bxmhgv5r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.NXYEQh/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist
    writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/lq/q_5j5j1d2d5_v7w4bxmhgv5r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.NXYEQh/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist
    2017-09-14 16:45:13.717753+0800 XCTRunner[2688:701460] Running tests...
    2017-09-14 16:45:14.727374+0800 XCTRunner[2688:701460] Continuing to run tests in the background with task ID 1
    Test Suite 'All tests' started at 2017-09-14 16:45:14.890
    Test Suite 'WebDriverAgentRunner.xctest' started at 2017-09-14 16:45:14.894
    Test Suite 'UITestingUITests' started at 2017-09-14 16:45:14.895
    Test Case '-[UITestingUITests testRunner]' started.
        t =     0.00s     Start Test at 2017-09-14 16:45:14.899
        t =     0.01s     Set Up
    2017-09-14 16:45:14.936272+0800 XCTRunner[2688:701560] [User Defaults] Failed to write value for key AutomationDisableFauxCollectionCells in CFPrefsPlistSource<0x1701056a0> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null)): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access, switching to read-only
    2017-09-14 16:45:15.031058+0800 XCTRunner[2688:701460] Built at Sep 14 2017 09:19:49
    2017-09-14 16:45:15.224069+0800 XCTRunner[2688:701460] ServerURLHere->http://99.6.91.22:8100<-ServerURLHere
        t =     3.20s     Find the Application "local.pid.53" 0x1740b6c20
        t =     3.20s         Snapshot accessibility hierarchy for local.pid.53
        t =     3.46s     Find the Application "local.pid.53" 0x1740b6c20
        t =     3.46s         Use cached accessibility hierarchy for local.pid.53
        t =     3.46s     Use cached accessibility hierarchy for local.pid.53
        t =     3.49s     Find the Application "local.pid.53" 0x1740b6c20
        t =     3.50s         Snapshot accessibility hierarchy for local.pid.53
        t =     3.64s     Find the Application "local.pid.53" 0x1740b6c20
        t =     3.64s         Use cached accessibility hierarchy for local.pid.53
    2017-09-14 16:45:25.314 xcodebuild[20603:567915]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
    /Users/waterhuang/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/86F41E4A-F9BF-4585-B2A9-C25DF7D17CCC/Session-WebDriverAgentRunner-2017-09-14_164525-Nq4VNG.log
    2017-09-14 16:45:25.315 xcodebuild[20603:567817] [MT] IDETestOperationsObserverDebug: (5246C677-3941-41EA-98A8-853990396271) Beginning test session WebDriverAgentRunner-5246C677-3941-41EA-98A8-853990396271 at 2017-09-14 16:45:25.314 with Xcode 8E3004b on target <DVTiOSDevice: 0x7fe2fcfdb1c0> {
            deviceSerialNumber:         C8QP5BQHG5MP
            identifier:                 bb7787b7ba9d57bb6f9c84273d22fe3204d1e547
            deviceClass:                iPhone
            deviceName:                 iPhone
            deviceIdentifier:           bb7787b7ba9d57bb6f9c84273d22fe3204d1e547
            productVersion:             10.3.3
            buildVersion:               14G60
            deviceSoftwareVersion:      (null)
            deviceArchitecture:         arm64
            deviceTotalCapacity:        12241596416
            deviceAvailableCapacity:    8145756160
            deviceIsTransient:          NO
            ignored:                    YES
            deviceIsBusy:               NO
            deviceIsActivated:          NO
            deviceActivationState:      Activated
            isPasscodeLocked:           NO
            deviceType:                 <DVTDeviceType:0x7fe2fcca88c0 Xcode.DeviceType.iPhone>
            supportedDeviceFamilies:    (null)
            applications:              (null)
            provisioningProfiles:      (null)
            activityProgress:          -2
            activityTitle:             
            hasInternalSupport:        NO
            isSupportedOS:             NO
            developerDiskMountError:   (null)
    (null)
        bootArgs:                  <unavailable>
            } ((null))
    
    
    
  • 我们项目中用 xpath 还算稳定。

  • 用 path...

  • adb 版本升级到最新,加上 automationName=uiautomator2

  • 看了百度的远程真机方案,感觉还是 ios-minicap 回显 +wda 远程操控做起来比较简单,这个月想要把这个搞出来,大家一起讨论下咯

  • Appium 包里面的先试试好不好使,不好使就自己下一个。

  • 我只是打酱油的,要搞这个还得恶补 JS😖

  • 66666

  • 这个很简单,给你一段代码参考一下,是论坛大神写的 wdaproxy 上的:
    https://github.com/openatx/wdaproxy

    tap: function(x, y) {
              var self = this;
              return $.ajax({
                url: "/session/" + self.sessionId + "/wda/tap/0",
                method: "POST",
                data: JSON.stringify({
                  x: x,
                  y: y
                }),
              }).then(function(ret) {
                if (ret.status !== 0) {
                  console.log(ret.value);
                } else {
                  return "Success";
                }
              })
            },
    
    initScreenSize: function() {
              $.\
              ({
                  url: "/status",
                })
                .then(function(ret) {
                  this.sessionId = ret.sessionId;
                  return $.ajax({
                    url: "/session/" + ret.sessionId + "/window/size",
                  })
                }.bind(this))
                .then(function(ret) {
                  this.display.width = ret.value.width;
                  this.display.height = ret.value.height;
                }.bind(this))
            },
    
  • 目前技术上的难点已经解决,看了 ios minicap 源码,直接连接它的服务端不停发截图过来就可以回显了。WebdriverAgent 也可以直接用 WebSocket 通讯发送命令就行了。就是现在缺少技术栈~~还需要人力和时间啊!有空多交流交流

  • 我们还没有大规模使用,目前主要在预言 ios 远程真机,想结合 ios minicap 和 WebdriverAgent 来搞~~

  • 我用的是开发者账号的证书打包的,你的错误还是百度一下看看?

  • 快来大神讨论- 3-