# iOS: WebDriverAgent tries to use port 0

**URL:** <https://forum.katalon.com/t/ios-webdriveragent-tries-to-use-port-0/10322>\
**Category:** Mobile Testing\
**Tags:** mobile-testing, katalon-studio\
**Created:** [April 17, 2018, 12:02pm UTC](https://forum.katalon.com/t/ios-webdriveragent-tries-to-use-port-0/10322 "2018-04-17T12:02:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milgrim](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Milgrim](https://forum.katalon.com/u/Milgrim)\
**Post date:** [April 17, 2018, 12:02pm UTC](https://forum.katalon.com/t/ios-webdriveragent-tries-to-use-port-0/10322/1 "2018-04-17T12:02:02Z")

</div>

Hello.

I try to run test on iOS devices, but they won’t show up in the device list.

I followed this documentation: [https://docs.katalon.com/display/KD/Mobile+on+macOS](https://docs.katalon.com/display/KD/Mobile+on+macOS)

My steps so far: Connected an iPad 4 with an iMac. Share the ethernet connection of the imac with the iPad, so both use the same LAN (wifi is in another LAN).

I compiled and deployed the WebDriverAgent software on the ipad and it starts with the following messages:

```auto
2018-04-17 12:18:05.377882+0200 WebDriverAgentRunner-Runner[1722:2691470] Running tests...2018-04-17 12:18:06.490991+0200 WebDriverAgentRunner-Runner[1722:2691470] Continuing to run tests in the background with task ID 1Test Suite 'All tests' started at 2018-04-17 12:18:07.236Test Suite 'WebDriverAgentRunner.xctest' started at 2018-04-17 12:18:07.243Test Suite 'UITestingUITests' started at 2018-04-17 12:18:07.261Test Case '-[UITestingUITests testRunner]' started. t = 0.01s Start Test at 2018-04-17 12:18:07.271 t = 0.01s Set Up2018-04-17 12:18:07.303505+0200 WebDriverAgentRunner-Runner[1722:2691470] Built at Apr 6 2018 17:29:362018-04-17 12:18:07.391173+0200 WebDriverAgentRunner-Runner[1722:2691470] ServerURLHere->http://192.168.2.3:0<-ServerURLHere2018-04-17 12:31:57.607130+0200 WebDriverAgentRunner-Runner[1722:2691470] Continuing to run tests in the background with task ID 5

```

So it binds to port 0, which doesn’t look right. Port 8100 is not in use.

```auto
NMAP:
PORT STATE SERVICE  
80/tcp open http     
81/tcp open hosts2-ns
82/tcp open xfer     
83/tcp open mit-ml-dev                     
443/tcp open https                          
1080/tcp open socks                                             
3128/tcp open squid-http                                 
8000/tcp open http-alt                
8080/tcp open http-proxy                         
8088/tcp open radan-http
8888/tcp open sun-answerbook                     
62078/tcp open iphone-sync

```

Any idea suggestion why the port is not used? When using wifi it also uses port 0.

Looking forward to your answers.

Milgrim

---

<div class="post-metadata">

**Author:** ![Milgrim](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Milgrim](https://forum.katalon.com/u/Milgrim)\
**Post date:** [April 18, 2018, 10:03am UTC](https://forum.katalon.com/t/ios-webdriveragent-tries-to-use-port-0/10322/2 "2018-04-18T10:03:43Z")

</div>

Explanation & solution: [https://github.com/facebook/WebDriverAgent/issues/661](https://github.com/facebook/WebDriverAgent/issues/661)

---

<div class="post-metadata">

**Author:** ![Chris\_Trevarthen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/chris_trevarthen/32/358_2.png) [@Chris\_Trevarthen](https://forum.katalon.com/u/Chris_Trevarthen)\
**Post date:** [May 15, 2018, 9:08pm UTC](https://forum.katalon.com/t/ios-webdriveragent-tries-to-use-port-0/10322/3 "2018-05-15T21:08:53Z")

</div>

The USE\_PORT environment variable needs to be set when running the WebDriverAgent, otherwise it defaults to 0.

```auto
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=4AE3673B-8013-4164-96F4-1702D54BB67E' test USE_PORT=8100

```
