Unable to Launch Web Driver Agent in Appium 2.0 [SOLVED] Changed to How to run 2 Real devices Simultaneously on Mac?

I’m new to appium. I started my journey as Automation Test Developer for the last 1.5 Years and I’m working on an already created framework which was 10 years old and i learnt so much things. Yesterday, I moved my office’s Mac from Appium 1.0 to Appium 2.0. I got so many errors but i figured it out but one thing is not working fine for me.

I can able to add ios-webkit-debug-proxy to my mac also Proxy port which connect the Real Device is working fine (Ex : ios_webkit_debug_proxy -c 00008030-0005299636F0C02E:56255) but while trying to run the particular port for appium server using command appium -p 4398 --webkit-debug-proxy-port 56255 it is not working and every time throws an error message that the The Port #xxxxx (iOS proxy port 56255) is in use please use another free port. I tried every possible thing but couldn’t get rid of this issue.

Also I changed the server URL path to Wd\hub to .
The /wd/hub base path was a legacy convention from the days of migrating from Selenium 1 to Selenium 2, and is no longer relevant. As such the default base path for the server is now /

I got above point but,

very hectic things. even can’t able to run the port using proxy iOS webkit

while running below command

appium -p 4398 --webkit-debug-proxy-port 27452

got an error as unrecognised arguments

then found one solution we need to use appium -p 4750 --driver-xcuitest-webdriveragent-port 67321.

and worked for me but even after we took a new port it gives an error as this port is in use

I tried by killing all running port but still can’t able to do it

Appium could you please look into this

Mac os : ventura 13.5
appium version : 2.0.1
node version : 20.5.0
npm version : 9.8.0
iOS : 16.5
Xcode : 14.3
Testing on real device

So could you please tell me the reason behind this or anything missed by me? Thanks in Advance.

Regards,
Krushant

webdriveragent port != webkit debug proxy port
In the driver supplied with Appium 2 there is no need to explicitly provide the debug proxy port anymore so the corresponding setting has been removed as obsolete.

So which command do we need to run ?

I mean to say I’m running 2 different ipads on same MacOS how the driver will know that this udid is connect to port 1 and the second udid is connected to Port 2 ?

simply start the server as usually without providing the above command line argument

You are right but what if I want to run different devices simultaneously on defferent port ?

@mykola-mokhnach any suggestions on this ?

@Aleksei could you please add your suggestions regarding this ?
Launch successfully and working fine but need to run two real device simultaneously on different appium port

I don’t have any other suggestion except of the above ones. Follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/parallel-tests.md to run parallel tests

parallel iOS driver port settings that should be unique:

  • appium server port
  • wda port (this is NOT webkit-debug-proxy-port! BUT wdaLocalPort)
  • video port (if you use)

If possible could you please share me the command to bind my device using device ID and port that would be really helpful for me.

For example:
I have one iPad with udid : 12345 and I want to run my automation test using appium with port 4730

In this case what will be the debug proxy command to bind the device and appium port

Thanks in Advance :slightly_smiling_face:

@Aleksei could you please give me your outputs

I do not use debug proxy port.

I do first start appium servers like:

[12:20:53.606] [main]     AppiumManager:              | startAppiumServer():     start appium with: [appium, --log-level, error, --port, 6001, --keep-alive-timeout, 1800, --session-override, --log-timestamp, --tmp, /Users/qa/Documents/appium_logs/ios, --use-plugins, execute-driver, --relaxed-security] 

[12:20:53.611] [main]     AppiumManager:              | startAppiumServer():     start appium with: [appium, --log-level, error, --port, 6011, --keep-alive-timeout, 1800, --session-override, --log-timestamp, --tmp, /Users/qa/Documents/appium_logs/ios, --use-plugins, execute-driver, --relaxed-security]

then start drivers using caps below and url that includes port of one started appium server:

// some phone iPhone QA6
[12:23:47.030]     AppiumDriverFactory:        | configureLocalAppium(): Capabilities {app: /Users/qa/Documents/test/ap..., automationName: XCuiTest, bundleId: com.xxx.staging, clearSystemFiles: true, derivedDataPath: /Users/qa/Library/Developer..., deviceName: iPhone QA6, forceAppLaunch: true, fullContextList: true, fullReset: false, iosInstallPause: 500, launchWithIDB: true, mjpegServerPort: 6206, nativeWebTap: true, newCommandTimeout: 180, noReset: true, platformName: IOS, platformVersion: 16.0, processArguments: {"args":["-featureFlag.XY: ..., sendKeyStrategy: grouped, shouldTerminateApp: true, shouldUseSingletonTestManager: false, showXcodeLog: false, tapWithShortPressDuration: 20, udid: 00008030-000E245001C02..., useJSONSource: true, useNewWDA: false, usePrebuiltWDA: true, waitForAppScript: false, waitForQuiescence: false, wdaLaunchTimeout: 120000, wdaLocalPort: 6106, wdaStartupRetries: 4, xcodeOrgId: OrgId_xxx, xcodeSigningId: iPhone Developer} 

// some another phone iPhone QA3
[12:23:47.032]     AppiumDriverFactory:        | configureLocalAppium(): Capabilities {app: /Users/qa/Documents/test/ap..., automationName: XCuiTest, bundleId: com.xxx.staging, clearSystemFiles: true, derivedDataPath: /Users/qa/Library/Developer..., deviceName: iPhone QA3, forceAppLaunch: true, fullContextList: true, fullReset: false, iosInstallPause: 500, launchWithIDB: true, mjpegServerPort: 6203, nativeWebTap: true, newCommandTimeout: 180, noReset: true, platformName: IOS, platformVersion: 16.0, processArguments: {"args":["-featureFlag.XY: ..., sendKeyStrategy: grouped, shouldTerminateApp: true, shouldUseSingletonTestManager: false, showXcodeLog: false, tapWithShortPressDuration: 20, udid: 6f7443f73a9be0bd44aa06f336e..., useJSONSource: true, useNewWDA: false, usePrebuiltWDA: true, waitForAppScript: false, waitForQuiescence: false, wdaLaunchTimeout: 120000, wdaLocalPort: 6103, wdaStartupRetries: 4, xcodeOrgId: OrgId_xxx, xcodeSigningId: iPhone Developer} 

code:

final String baseURL = "http://localhost:";
// Appium 2.0 does not need `wd/hub`
final String minorURL = "/"; // /wd/hub
final String port = String.valueOf(ports.appium);
driver = new IOSDriver(new URL(baseURL + port + minorURL), capabilities);
1 Like

Will try this Thank you so much :slightly_smiling_face:

Hi @Aleksei
I have tried below things on my company’s mac as below :

Below is the code which is used by our framework :
if (this.m_isIOS) {
this.m_driver = new IOSDriver(new URL(this.m_serverUrl), capabilities);
} else {
this.m_driver = new AndroidDriver(new URL(this.m_serverUrl), capabilities);
}

where this.m_serverUrl will be passed through the Property file below :

testPlatform = iOS
androidShellVersion = 12.6
wdaLocalPort = 8121
chromedriverPath = E:/Selenium Standalon Run New Chrome Driver/chromedriver.exe
serverUrl = http://192.168.133.88:4725/
checkWebviewTimeout = 30000

still we got the error as "8100 Port is in use Please try to run the device on another port " So Could you please tell me how to resolved this problem as the another device is listening to the same Port i.e. 8100

is there any solution for this ?

Regards,
Krushant

First hide sensitive info in your post like login name and passcodes.

Second find out who occupy 8100 port.

Third print capability values before open driver so you can double check that you use with one device e.g. 8100 but with other another value

Hi @Aleksei

Thank you for your information for the first point and second point i have used below things in terminal and now i can able to run the both real iOS 16 devices in Appium 2.0

appium -p 4740 --default-capabilities ‘{“appium:wdaLocalPort”: 8100, “appium:udid”: “678910”}’

appium -p 4750 --default-capabilities ‘{“appium:wdaLocalPort”: 8200, “appium:udid”: “123456”}’

Thank you for your inputs and guidance and proper reply throughout the Thread. Don’t know this is the valid way or not but its very helpful for me

and i will follow all your points and information for sure.

Regards,
Krushant