Skip to content
This repository was archived by the owner on Dec 26, 2019. It is now read-only.
This repository was 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

Description

@cyildirim

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);
}

Activity

marekcirkos

marekcirkos commented on Apr 6, 2017

@marekcirkos
Contributor

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

cyildirim

cyildirim commented on Apr 6, 2017

@cyildirim
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

marekcirkos commented on Apr 6, 2017

@marekcirkos
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

cyildirim commented on Apr 7, 2017

@cyildirim
Author

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @marekcirkos@cyildirim

        Issue actions

          How can i change WebdriverAgent port with command-line parameters ? · Issue #538 · facebookarchive/WebDriverAgent