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
338 stars 102 forks source link

Cannot launch .app on real device on Device farm #1395

Closed jekson0702 closed 1 month ago

jekson0702 commented 1 month ago

Is it a bug or feature?

I have .app file builded for real device in Xcode. I can install it via Appium Inspector or via Xcode on real Iphone

But i cannot launch it via Device farm. For launch I use df:udids property for multiple device selection.

Logs from appium server POST /wd/hub/session {"capabilities":{"firstMatch":[{"acceptInsecureCerts":true,"appium:app":"/Users/jekson/Downloads/myApp.app","appium:autoAcceptAlerts":true,"appium:automationName":"XCuiTest","appium:enforceAppInstall":true,"appium:reduceMotion":true,"df:udids":"00008110-00061012149A502E","pageLoadStrategy":"normal","platformName":"IOS","unhandledPromptBehavior":"accept"}]}}

and deviceType:simulator filter is enabled automatically so i have org.openqa.selenium.SessionNotCreatedException

[device-farm-main] Max session count: 8, Busy device count: 0
[device-farm-main] Waiting for free device. Filter: {"platform":"ios","deviceType":"simulator","udid":["00008110-00061012149A502E"],"busy":false,"userBlocked":false}}

GIST

saikrishna321 commented 1 month ago

@jekson0702 Please provide full server logs.

jekson0702 commented 1 month ago

@saikrishna321 I updated my GIST, check link pls

[device-farm-main] Max session count: 8, Busy device count: 0 [device-farm-main] Waiting for free device. Filter: {"platform":"ios","deviceType":"simulator","udid":["00008110-00061012149A502E"],"busy":false,"userBlocked":false}}

the message is repeated until an error appears

[AppiumDriver@5410] Command 'createSession' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was handled by these: ["device-farm"]. [AppiumDriver@5410] Encountered internal error running command: Error: No device matching request.. Device request: {"platform":"ios","deviceType":"simulator","udid":["00008110-00061012149A502E"]} at generator (/Users/jekson/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/device-utils.js:125:19) at Generator.next () at Sm (/Users/jekson/.appium/node_modules/appium-device-farm/lib/webpack:/appium-device-farm/lib/src/device-utils.js:5:48) [HTTP] <-- POST /wd/hub/session 500 300101 ms - 780

saikrishna321 commented 1 month ago

@jekson0702 You are sending a real device udid in the request

[device-farm-main] iOS device with udid 00008110-00061012149A502E plugged! updating device list..

As the app capability is give with .app its considered as simulator. Please provide IPA file which is supported for real iOS device.

[device-farm-main] Waiting for free device. Filter: {"platform":"ios","deviceType":"simulator","udid":["00008110-00061012149A502E"],"busy":false,"userBlocked":false}}
jekson0702 commented 1 month ago

@saikrishna321 Yeah, I know that. But appium without Device farm (and Xcode too) provides an opportunity to launch .app files on real devices as I wrote above. So is it a feature of device farm to enable "deviceType":"simulator" automatically when .app file is used?

jekson0702 commented 1 month ago

I mean if you select Iphone13 for example as target in Xcode and build that, you receive myApp.app file that you can use for real devices in Appium (without farm), or install via Xcode.

saikrishna321 commented 1 month ago

@jekson0702 for device-farm to work with real device you need IPA file.