Can we run our test scripts if the appium server and the mobile device are only connected via USB?


Currently I am running my test scripts where the appium server and mobile device are on the same WiFi network.

But when the appium server and the mobile device are on a different WiFi network / not connected to WiFi but only connected via USB i get the below error when I try to my scripts.

Exception in thread “main” org.openqa.selenium.remote.UnreachableBrowserException: Could not start a newsession. Possible causes are invalid address of the remote server or browser start-up failure.

Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’

System info: host: ‘admin-PC’, ip:‘’, ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’,
java.version: ‘1.8.0_45’

Driver info: driver.version:AndroidDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at io.appium.java_client.AppiumDriver.execute(
at org.openqa.selenium.remote.RemoteWebDriver.startSession(
at org.openqa.selenium.remote.RemoteWebDriver.(
at org.openqa.selenium.remote.RemoteWebDriver.(
at io.appium.java_client.AppiumDriver.(
at MFKPackage1.MFKSmartPhone1.initializeApp(
at MFKPackage1.MFKSmartPhone1.main(
Caused by: Connection reset
at Source)
at Source)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(
at org.apache.http.protocol.HttpRequestExecutor.execute(
at org.apache.http.impl.execchain.MainClientExec.execute(
at org.apache.http.impl.execchain.ProtocolExec.execute(
at org.apache.http.impl.execchain.RetryExec.execute(
at org.apache.http.impl.execchain.RedirectExec.execute(
at org.apache.http.impl.client.InternalHttpClient.doExecute(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(
at org.openqa.selenium.remote.HttpCommandExecutor.execute(
at org.openqa.selenium.remote.RemoteWebDriver.execute(

8 more

Is it necessary that both appium server and the mobile device to be on the same WiFi network? Cannot we run our test scripts via USB?

@rohansurya, we run our tests with devices that are on different WiFi’s than the appium server.

I wish I had something more helpful than debug steps (which you likely have already done). I would do the following:

  1. Verify the server can see the device through adb (adb devcies)
  2. Check if appium still works when the device is on the same WiFi
  3. Verify no other changes were made when the device is on a different WiFi than the server
  4. Check your code that is trying to connect to the device – are you using some static value which would be different on the other WiFi.
1 Like

@willosser…i tried different scenarios and found out that the appium server (laptop) need to be on a network
(connected to some network, i.e. either WiFi / LAN / hotspot, etc.) at any point in time else we get “getaddrinfo ENOENT” error.

My issue is resolved now. Thank You!!

Hi Rohan,

It’ll be great if you can assist me on this issue you faced where you wanted to connect with android devices on different networks via appium.

I am trying to do the same but to no avail!

1 Like

Hi, were you able to find a solution? I seem to have the same problem.