Webdriveragent: WDA does not listen port 8100

Created on 21 Jul 2017  Â·  16Comments  Â·  Source: facebookarchive/WebDriverAgent

I have suffer this problem for days, it look like wha does not listen on 8100,
here is full start log ,i use real devices ,iOS version is 9.3

`macdeMacBook-Pro:WebDriverAgent mac$ xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=98c020db3326922fcdce563280eb429b5c50a3f4 IPHONEOS_DEPLOYMENT_TARGET=9.3 test
Build settings from command line:
IPHONEOS_DEPLOYMENT_TARGET = 9.3

2017-07-21 15:40:24.423 xcodebuild[12427:562987] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/mac/Library/Developer/Xcode/DerivedData/WebDriverAgent-gfevjdguthuyyrcwvravjwrkfhxj/Logs/Test/8827F950-7DA8-4811-A7D8-3A4F888D089E/Session-WebDriverAgentRunner-2017-07-21_154024-BrdTAs.log
2017-07-21 15:40:24.424 xcodebuild[12427:562973] [MT] IDETestOperationsObserverDebug: (F38879DC-795E-40AB-89A8-93C45D1FC038) Beginning test session WebDriverAgentRunner-F38879DC-795E-40AB-89A8-93C45D1FC038 at 2017-07-21 15:40:24.423 with Xcode 8E3004b on target {
deviceSerialNumber: F17S6ALAG5MP
identifier: 98c020db3326922fcdce563280eb429b5c50a3f4
deviceClass: iPhone
deviceName: monley
deviceIdentifier: 98c020db3326922fcdce563280eb429b5c50a3f4
productVersion: 9.3.3
buildVersion: 13G34
deviceSoftwareVersion: 9.3.3 (13G34)
deviceArchitecture: arm64
deviceTotalCapacity: 12756062208
deviceAvailableCapacity: 8036732928
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType:
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:
hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
bootArgs:
} (9.3.3 (13G34))
=== 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/tp/b6dmbgc166n5nfs6p8sn5zsw0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/f13634fe0a67094fa0813a179591128f/98c020db3326922fcdce563280eb429b5c50a3f4/WebDriverAgentRunner-Runner.app
state->new_bundle: /Users/mac/Library/Developer/Xcode/DerivedData/WebDriverAgent-gfevjdguthuyyrcwvravjwrkfhxj/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
state->dst_bundle: /var/folders/tp/b6dmbgc166n5nfs6p8sn5zsw0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.hYSixM/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE
dst_ipa: /var/folders/tp/b6dmbgc166n5nfs6p8sn5zsw0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.hYSixM/WebDriverAgentRunner-Runner.app_sparse.ipa
__MDMDirectoryDiff_block_invoke.37:1473 calling writeDictToFile with: /var/folders/tp/b6dmbgc166n5nfs6p8sn5zsw0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.hYSixM/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist
writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/tp/b6dmbgc166n5nfs6p8sn5zsw0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.hYSixM/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist
2017-07-21 15:40:16.867 XCTRunner[1460:1200165] Running tests...
2017-07-21 15:40:17.722 XCTRunner[1460:1200165] Continuing to run tests in the background with task ID 1
Test Suite 'All tests' started at 2017-07-21 15:40:18.469
Test Suite 'WebDriverAgentRunner.xctest' started at 2017-07-21 15:40:18.472
Test Suite 'UITestingUITests' started at 2017-07-21 15:40:18.473
Test Case '-[UITestingUITests testRunner]' started.
t = 0.00s Start Test at 2017-07-21 15:40:18.478
t = 0.01s Set Up
2017-07-21 15:40:18.490 XCTRunner[1460:1200165] Built at Jul 21 2017 14:23:38
2017-07-21 15:40:18.520 XCTRunner[1460:1200165] ServerURLHere->http://172.31.2.4:0<-ServerURLHere
`

the port always is 172.31.2.4:0 ,i connect iPhone to mac by usb ,i also try run command proxy 8100 8100, when i visit localhost:8100/status or 172.31.2.4:8100/status,bot response could not connect to service

Most helpful comment

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.

All 16 comments

@monleylu https://github.com/appium/appium/issues/8888 might have a solution for your problem.

@mykola-mokhnach i just start WDA to debug APP,not use appium to start WDA,i download WDA in an other directory
xcodebuild log :https://gist.github.com/monleylu/9793476c0cb96082f0b340af08c0ffe1
diagnostic log :https://gist.github.com/monleylu/8286f6506775981ff4ae51e2e84ae662

environment:
node -v
v6.11.1
npm -v
3.10.10
xcode -v
8.3.3
this problem still not resolved , i download WDA in directory '~/WebDriverAgent'

  • Do you pass any additional arguments or envs like --port or USE_PORT? This is how you can overwrite it. Otherwise we use default.
  • Is 8100 free before you boot WDA?

@marekcirkos i start use command "xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=8e7d0ac6722547dc7061ca028fd3f5e4c1031336 test" to start WDA without additional arguments or envs parameter, and i use command "netstat -aln|grep 8100" to check ,port is free to use.

ServerURLHere->http://192.168.1.102:0<-ServerURLHere
i do not understand how program listen 0 port

@monleylu Me as well. Why even 0? I assume you checked the port and it does not work?
Meaning it is not simple print issue?

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.

Do you have env var USE_PORT set to anything? That would explain it

Nope. I didn't find any env var named USER_PORT.

Hello all.
I really need your help, i had my appium totally setup but last thursday i accepted an update and the problems started, i am getting a lot of problems with iOS ever since i accepted those changes, i have been searching in the web to solve this issue for a couple of days already and i have not found the solution, i wonder if you could help me please.
Note: this issue is similar to the situation i am going through.

Below the logs i am getting
https://docs.google.com/document/d/1_Y113uMw08Rv9kU_Dz0xElz7ujhVKcULhrYiE3PqmD8/edit?usp=sharing

i would really appreciate the help

screen shot 2018-04-15 at 7 44 22 pm

@weamylady2 and @marciok

below is what I see in FBWebServer.m file , what to change here can you please help
{
server.port = (UInt16)port;
NSError *innerError = nil; ===> 124th Line
BOOL started = [server start:&innerError];
if (!started) {
if (!error) {
return NO;

@bobby06495

Change

server.port = (UInt16)port;

to

server.port = 8100;

You can probably do something fancy in case of error, but this works too. (It will ignore variables you set somewhere else!)

@fi78 Did it help?

I did not follow that suggestion rather I installed iDeviceConsole and it
worked

Thanks & Regards
N.Sashikiran
Phno:- +6587261541

On Thu, May 10, 2018 at 1:12 PM, Marek Cirkos notifications@github.com
wrote:

@fi78 https://github.com/fi78 Did it help?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/WebDriverAgent/issues/661#issuecomment-387978479,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AknH26kNRFr257hmePz8ZOyxcmmWx5epks5tw-97gaJpZM4OfE5-
.

I think that modifying the code is not a good idea. I solved this problem in the following way:

export USE_PORT=8100
Was this page helpful?
0 / 5 - 0 ratings