AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
318 stars 98 forks source link

iphone screen not showing up when using the 'use device' feature #1252

Closed sudo-naim closed 1 month ago

sudo-naim commented 1 month ago
image

After clicking 'Use Device' button I can see the wda app in the phone opening and closing again and on the device-farm website it looks like the connection has been made but the screen doesn't show. Screenshot provided above.

Link to Appium logs

Appium server logs steps are:

saikrishna321 commented 1 month ago

/bin/sh: ios: command not found

[HTTP] <-- POST /device-farm/api/dashboard/installiOSWDA 200 16 ms - 91```

Please make sure you have install go-ios `npm install -g go-ios`
sudo-naim commented 1 month ago

@saikrishna321 i did it now but the issue still persists. New appium logs after installing go-ios: https://gist.github.com/sudo-naim/e86ba6d5c29622e9e6944d8f3fc24e5c

saikrishna321 commented 1 month ago

@sudo-naim Are you sure you have resigned the WDA with your provision profile? [9ce3fc48][XCUITestDriver@0b47] Failed to kill 'com.atd.pro.xctrunner'. Original error: Cannot read properties of undefined (reading 'endsWith')

sudo-naim commented 1 month ago

@saikrishna321 i belive so, because when i didn't i was getting another error. Is there a way to test this ?

saikrishna321 commented 1 month ago

@sudo-naim What happens when you access http://localhost:63358 here 63358 is the port MJPEG Server is running from the logs.

Also do you see any errors in the browser console

sudo-naim commented 1 month ago

@saikrishna321 when i access the port 63358 i get this appium server log: [b95d0d0e][iProxy@00008120:63358] Connection was refused to port 63358 [b95d0d0e][iProxy@00008120:63358] Connection was refused to port 63358

saikrishna321 commented 1 month ago

@sudo-naim Create a new session and give it a try with the new port when you see the above screen.

sudo-naim commented 1 month ago

@saikrishna321 excuse my ignorance but about which port are we talking about and where can i configure this port or is it some kind of appium parameter ?

or do you mean giving another webdriveragent port before starting appium server?

saikrishna321 commented 1 month ago

@sudo-naim When you click on use-device check the logs for "appium:mjpegServerPort" try accessing that port in new tab.

sudo-naim commented 1 month ago

@saikrishna321 when i accessed that port i got a screenshot of my device

image

EDIT: it's actually not a screenshot but a screen mirror of my device i can see everything i am doing on my device on that port

sudo-naim commented 1 month ago

@saikrishna321 i tried to record my steps but the video file is to large so here is a gif instead: aa

saikrishna321 commented 1 month ago

@sudo-naim Can you please share latest logs.

sudo-naim commented 1 month ago

@saikrishna321 damn, so when i access localhost:{{mjpegServerPort}}, i can see the screen mirror of my iphone but i cannot use the device like click or swipe

saikrishna321 commented 1 month ago

damn, so when i access localhost:{{mjpegServerPort}}, i can see the screen mirror of my iphone but i cannot use the device like click or swipe

That is expected. Is there any errors in the browser console. We are expected a mjpeg-stream API. Which I can't see in the logs.

Is this happening only on real device or even simulators?

sudo-naim commented 1 month ago

@saikrishna321 This is a real device iPhone 15, os: 17.5.1. new appium logs by also accessing mjpegServerPort : https://gist.github.com/sudo-naim/f64d21752210d85412a624174f12c038

saikrishna321 commented 1 month ago

Is there any errors in the browser console can you check this

sudo-naim commented 1 month ago

@saikrishna321 yes there is, here is a screenshot:

image
saikrishna321 commented 1 month ago

@sudo-naim Can you give start server with --plugin-device-farm-bind-host-or-ip=127.0.0.1 and see if this is solving?

saikrishna321 commented 1 month ago

@sudo-naim Please join slack for faster communication - https://join.slack.com/t/appiumtestparallel/shared_invite/zt-2tmkvgp2-QyWnT~Va4HsQD7h38G3kgQ

sudo-naim commented 1 month ago

@saikrishna321 you are the best! It works now! So the issue was because appium wasn't able to access my ip address or something and the reason could be because i am using a vpn at my workplace right ? I also joined the slack group for further discussions. Thanks again!