Cannot use physical device with VM

Hi

I have some Android and iOS tests to perform and am trying to use a VM plus a physical phone (Moto G4)…
For Android, I have a copy of KS installed on a Win 10 VM, I am using Remote Desktop to run.
(Performed an install of Appium Desktop 1.12.0 alongside Katalon 7.2.1 and Node.JS & Motorola phone drivers. Appium path set in KS. USB debugging is enabled in the phone. Phone is plugged into my Win 10 laptop).

When I open Katalon and try to either record or execute an Android test, the device plugged into my laptop is not recognised. For ref, we have a proxy and settings/password are set in Preferences. I have also added my proxy cert to keystore.

For iOS, I have a copy of KS for Mac (installed on a Mac), that I am dialling into from a PC (using VNC Viewer).
I have not tried running on the Mac side but wonder if I would get the same issue? Should I be able to use a VM along with a physical mobile?

I have some error messages in my log:
Tue Mar 03 22:05:10 GMT 2020
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1199)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259)
at com.kms.katalon.application.utils.ServerAPICommunicationUtil.sendAndReceiveData(ServerAPICommunicationUtil.java:231)
at com.kms.katalon.application.utils.ServerAPICommunicationUtil.invoke(ServerAPICommunicationUtil.java:123)
at com.kms.katalon.application.utils.ServerAPICommunicationUtil.post(ServerAPICommunicationUtil.java:52)
at com.kms.katalon.tracking.service.TrackingApiService.post(TrackingApiService.java:24)
at com.kms.katalon.tracking.service.TrackingService.sendEventPayload(TrackingService.java:52)
at com.kms.katalon.tracking.service.TrackingService.lambda$0(TrackingService.java:36)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Thanks a lot
Dan

@Dan_Bown,

You need to exclude localhost or 127.0.0.1 in Excludes field of Proxy settings.

Thanks

Hi @duyluong
afraid that is still not working - I also tried changing the proxy settings to ‘no proxy’ and ‘use system settings’ but no luck.
Message still:
Wed Mar 04 11:47:40 GMT 2020
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1199)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259)
at com.kms.katalon.application.utils.ServerAPICommunicationUtil.sendAndReceiveData(ServerAPICommunicationUtil.java:231)
at com.kms.katalon.application.utils.ServerAPICommunicationUtil.invoke(ServerAPICommunicationUtil.java:123)
at com.kms.katalon.application.utils.ServerAPICommunicationUtil.post(ServerAPICommunicationUtil.java:52)
at com.kms.katalon.tracking.service.TrackingApiService.post(TrackingApiService.java:24)
at com.kms.katalon.tracking.service.TrackingService.sendEventPayload(TrackingService.java:52)
at com.kms.katalon.tracking.service.TrackingService.lambda$0(TrackingService.java:36)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Thanks
Dan

@Dan_Bown
Please share us the execution log, not the error log.

Hi @duyluong
can you explain how and what to provide please?
There is nothing in ‘Log Viewer’ or ‘Console’ view at this point, since I cannot start execution.
Cheers Dan

Hi
any more advice on what details I can capture to see why this is not working for me please?
Regards
Dan

@Dan_Bown
Please create a test case with this script:

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

Mobile.startApplication('path to your app', false)

run the test case and share with us output in the Console tab.

Capture

Hi
sorry, I can create the script but my problem is that I have nothing to execute it with - there is no device listed, hence nothing in the Console tab.
I have tried one additional tweak - in ‘Remote Desktop’ I have given permissions for access to ports and plug and play devices. This setting is at the initial connection config screen. No change though but I can confirm that the VM is able to access my mobile through list of drives.
Nb - I do have another post active - is this instruction meant for that? Unable to execute Mobile test (AbstractMethodError) -Katalon 6.1.2
Regards
Dan

Update to the above.
Still not working but it may be that some USB devices are not passed through to the VM. When I run ADB in the VM, no devices appear.
Hope that I can find some way to redirect the USB but looks like this is one for a sys admin.
Will update this post if I get any progress, thanks Dan.

Hi. Wow I can connect from Katalon Studio to Raspberry pi App from VNC viewer?

You cannot!
What will be the real benefit of such setup?