Appium Appium Destopv1.2.3 中 WDA 启动后监听 ip 和端口的疑问

water · 2017年10月16日 · 最后由 菜鸟 回复于 2020年05月08日 · 1747 次阅读

在安装了新的 Appium Destop v1.2.3,(Appium1.7.1) 之后,按照原来版本的方法编译内置的 WDA 之后,它运行监听的端口从原来的 127.0.0.1:8100,变成了手机上的 ip,端口显示为 0:

xcodebuild -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=设备udid test
2017-10-16 10:35:24.887 xcodebuild[2369:29681]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/waterhuang/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/FB8FD838-F500-47E2-8A8D-62C4FA40C69B/Session-WebDriverAgentRunner-2017-10-16_103524-XaUqwX.log
2017-10-16 10:35:24.888 xcodebuild[2369:29673] [MT] IDETestOperationsObserverDebug: (76DA1E74-6A91-48BD-BC94-D8F28966D642) Beginning test session WebDriverAgentRunner-76DA1E74-6A91-48BD-BC94-D8F28966D642 at 2017-10-16 10:35:24.887 with Xcode 8E3004b on target <DVTiOSDevice: 0x7fcd371d60d0> {
        deviceSerialNumber:         C8QP5BQHG5MP
        identifier:                 did
        deviceClass:                iPhone
        deviceName:                 iPhone
        deviceIdentifier:           did
        productVersion:             10.3.3
        buildVersion:               14G60
        deviceSoftwareVersion:      10.3.3 (14G60)
        deviceArchitecture:         arm64
        deviceTotalCapacity:        12241596416
        deviceAvailableCapacity:    7845101568
        deviceIsTransient:          NO
        ignored:                    NO
        deviceIsBusy:               NO
        deviceIsActivated:          YES
        deviceActivationState:      Activated
        isPasscodeLocked:           NO
        deviceType:                 <DVTDeviceType:0x7fcd36d741d0 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/udid/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.NisrwR/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.NisrwR/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.NisrwR/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.NisrwR/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist
2017-10-16 10:35:44.400461+0800 XCTRunner[2170:709271] Running tests...
2017-10-16 10:35:45.355720+0800 XCTRunner[2170:709271] Continuing to run tests in the background with task ID 1
Test Suite 'All tests' started at 2017-10-16 10:35:45.502
Test Suite 'WebDriverAgentRunner.xctest' started at 2017-10-16 10:35:45.506
Test Suite 'UITestingUITests' started at 2017-10-16 10:35:45.508
Test Case '-[UITestingUITests testRunner]' started.
    t =     0.00s     Start Test at 2017-10-16 10:35:45.512
    t =     0.01s     Set Up
2017-10-16 10:35:45.529011+0800 XCTRunner[2170:709271] Built at Oct 16 2017 10:34:12
2017-10-16 10:35:45.562365+0800 XCTRunner[2170:709271] ServerURLHere->http://99.6.91.20:0<-ServerURLHere

这上面的 99.6.91.20 是手机的 ip,这上面显示端口为 0。

有谁遇到过这个问题么?

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 6 条回复 时间 点赞

我也遇到了 LZ 解决了吗? @weamylady

yyy 回复

解决了:
https://github.com/facebook/WebDriverAgent/issues/661#issuecomment-338920833
看我的回复:
I'm stuck in this issue, and found a workaround then.
Open the appium-xcuitest-driver/WebDriverAgent/WebDriverAgentLib/Routing/FBWebServer.m, and set the port to 8100 in line 124.
Then it works well.
It seems something is wrong while WDA determining the default port.

但是这个问题好像并不影响使用,是吧?

尝试着找到./appium-xcuitest-driver/WebDriverAgent/WebDriverAgentLib/Routing/FBWebServer.m文件,第 124 行是这样的NSError *innerError = nil;

sini 回复

是并不影响使用

bug 真多啊这个博客平台

湿哒哒撒

需要 登录 後方可回應,如果你還沒有帳號按這裡 注册