Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

How can i change WebdriverAgent port with command-line parameters ? #538

Closed
cyildirim opened this issue Apr 4, 2017 · 4 comments
Closed

Comments

@cyildirim
Copy link

I try to change 8100 port to anything else over command-line in order to perform the parallel execution. I saw that it is possible to change port at FBConfigurationTests.

Is there any possible way to change port over command-line?

I tried below line to change port but it failed.
xcodebuild -configuration WebDriverAgent USE_PORT 8200


+ (NSRange)bindingPortRange
{
  // 'WebDriverAgent --port 8080' can be passed via the arguments to the process
  if (self.bindingPortRangeFromArguments.location != NSNotFound) {
    return self.bindingPortRangeFromArguments;
  }
#
  // Existence of USE_PORT in the environment implies the port range is managed by the launching process.
  if (NSProcessInfo.processInfo.environment[@"USE_PORT"]) {
    return NSMakeRange([NSProcessInfo.processInfo.environment[@"USE_PORT"] integerValue] , 1);
  }

  return NSMakeRange(DefaultStartingPort, DefaultPortRange);
}

@marekcirkos
Copy link
Contributor

You can definitely modify scheme to do it, not sure if you can do it from command line

@cyildirim
Copy link
Author

Hi Marek,

Thanks for your answer. So I understand that it possibly needs code implementation to change port over command line. If yes you can close this ticket. Probably , I am going to fork it and work on it.

@marekcirkos
Copy link
Contributor

@cyildirim You can already change port by passing either arg or env. Problem here is Xcode needs to pass them to WDA. You can definitely do this via scheme definition, I am not sure if xcodebuild supports it from command line

@cyildirim
Copy link
Author

cyildirim commented Apr 7, 2017

I had able to use over xcodebuild after edit scheme like this

image
image

xcodebuild build-for-testing test-without-building  -scheme WebDriverAgentRunner  -configuration Debug WDAPORT=9990

Thanks !

imurchie referenced this issue in appium/WebDriverAgent Nov 16, 2017
* Move resources lock to the top hierarchy layer

* Synchronize stop as well

* Rename lock
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants