Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start appium session when device-farm-plugin is enabled #1410

Open
Stefankoff opened this issue Oct 7, 2024 · 10 comments
Open

Cannot start appium session when device-farm-plugin is enabled #1410

Stefankoff opened this issue Oct 7, 2024 · 10 comments

Comments

@Stefankoff
Copy link

When i start new appium session on IOS real device i have an error Original error: Cannot destructure property 'appBundleId' of '(intermediate value)' as it is null.
in previous versions all works fine
I use automation resign for WDA with my payed apple developer account
i saw some similar problems, but why i must use your "wda-resign.ipa" if all work fine with it "classic" version

2024-10-07 19:08:12:864 - [device-farm-main] Installing Resigned WDA on real device
2024-10-07 19:08:12:867 - [AppiumDriver@2552] 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","images"].
2024-10-07 19:08:12:974 - [HTTP] <-- POST /session 500 123 ms - 664

@saikrishna321
Copy link
Member

@Stefankoff Have you uploaded the ipa file from dashboard ?

@Stefankoff
Copy link
Author

Stefankoff commented Oct 8, 2024

@saikrishna321 Does it have to be ipa from dashboard? I can't use the wda that comes with xcuitest-driver anymore?
So dashboard will always use own ipa from now?
"Have you uploaded the ipa file from dashboard ?" - Yes, its work with it, when I run tests. But wont when I click "Use device" in device-farm page
image

@saikrishna321
Copy link
Member

@Stefankoff we have script to help you build ipa from wda source

Please check the section

How do I build WebDriverAgent from source?

https://devicefarm.org/ios-signing/

@saikrishna321
Copy link
Member

@Stefankoff please share full logs when you click Use Device to access device for live testing

@Stefankoff
Copy link
Author

@saikrishna321 Logs when i click Use Device
2024-10-08 15:22:05:681 - [device-farm-main] Updated devices with filter: {"udid":{"$in":["0000XXXXXXXXXXXXXX"]}}
2024-10-08 15:22:06:427 - [device-farm-main] Unexpected data: {"Error":"ApplicationVerificationFailed","ErrorDetail":-402620395,"ErrorDescription":"Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.aPCfwq/extracted/Payload/WebDriverAgentRunner-Runner.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)"}
2024-10-08 15:22:06:428 - [device-farm-main] The installation of 'com.ria.auto.webDriverAgentRunner' succeeded after 746ms
2024-10-08 15:22:06:429 - [HTTP] <-- POST /device-farm/api/dashboard/installiOSWDA 200 748 ms - 91
2024-10-08 15:22:06:431 - [HTTP] --> POST /device-farm/api/dashboard/appiumSession {"udid":"00000XXXXXXXXXXXXXX","origin":"http://localhost:4723"}
2024-10-08 15:22:06:431 - [device-farm-main] Received non-webdriver request with url /device-farm/api/dashboard/appiumSession. So, not proxying it to downstream.
2024-10-08 15:22:06:433 - [device-farm-main] Updated devices with filter: {"udid":{"$in":["0000XXXXXXXXXXXXXX"]}}
2024-10-08 15:22:06:454 - [HTTP] --> POST /wd/hub/session {"capabilities":{"alwaysMatch":{"platformName":"iOS","appium:automationName":"XCUITest","appium:newCommandTimeout":120,"appium:udid":"0000XXXXXXXXXXXXXX","df:skipReport":true,"appium:mjpegServerPort":58078,"appium:waitForQuiescence":false,"appium:wdaEventloopIdleDelay":0,"appium:eventLoopIdleDelaySec":0,"appium:waitForIdleTimeout":0,"appium:settings":{"mjpegServerFramerate":34,"mjpegServerScreenshotQuality":75,"mjpegScalingFactor":100,"animationCoolOffTimeout":0}},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"iOS","appium:automationName":"XCUITest","appium:newCommandTimeout":120,"appium:udid":"0000XXXXXXXXXXXXXX","df:skipReport":true,"appium:mjpegServerPort":58078,"appium:waitForQuiescence":false,"appium:wdaEventloopIdleDelay":0,"appium:eventLoopIdleDelaySec":0,"appium:waitForIdleTimeout":0,"appium:settings":{"mjpegServerFramerate":34,"mjpegServerScreenshotQuality":75,"mjpegScalingFactor":100,"animationCoolOffTimeout":0},"appium:usePreinstalledWDA":true,"appium:updatedWDABundleId"...
2024-10-08 15:22:06:454 - [device-farm-main] Received non-webdriver request with url /wd/hub/session. So, not proxying it to downstream.
2024-10-08 15:22:06:455 - [HTTP] <-- POST /wd/hub/session 404 1 ms - 211
2024-10-08 15:22:06:456 - [HTTP] <-- POST /device-farm/api/dashboard/appiumSession 400 25 ms - 241

@Stefankoff
Copy link
Author

@saikrishna321

@Stefankoff we have script to help you build ipa from wda source

Please check the section

How do I build WebDriverAgent from source?

https://devicefarm.org/ios-signing/

image
I followed the steps from the instructions and uploaded wda-resign.ipa to the device-farm apps tab.
When I run tests from the project, the test session starts on IOS 17, when I do the same on IOS 18, the wda build is displayed as untrusted.
But when Appium Inspector is running, the same error is displayed on both OS versions
Original error: InvalidArgumentError: property 'updatedWDABundleId' should not exist on both primary ({“platformName”: “IOS”, “automationName”: “XCUITest”, “xcodeOrgId”: “xxxxxxx”, “xcodeSigningId”: “iPhone Developer”, “updatedWDABundleId”: “com.xx.xx. xxxxx“, ‘showXcodeLog’:true, ‘includeSafariInWebviews’:true, ‘newCommandTimeout’:3600, ‘connectHardwareKeyboard’:true}) and secondary ({”app“:”/xxxx/xxxx/app.ipa”, ‘udid’: ‘xxxxx-xxxx’, ‘deviceName’: ‘iPhone xxxx’, ‘platformVersion’: ”17. 6.1“, ‘wdaLocalPort’:58233, ‘mjpegServerPort’:58234, ‘usePreinstalledWDA’:true, ‘updatedWDABundleId’: ‘com.xxx.xxxto.xxxxxx’, ‘updatedWDABundleIdSuffix’:”"}) object
Although wda is installed, could it be that the device-farm adds capabilities “usePreinstalledWDA”:true, “updatedWDABundleId”: “com.xxx.xxxto.xxxxxx”, “updatedWDABundleIdSuffix”:“” and mine are missing

here is an example of mine
{
“platformName": “IOS”,
“appium:automationName": “XCUITest”,
“appium:app": “/xx/xx/axx/app.ipa”,
“appium:xcodeOrgId": “xxxx”,
“appium:xcodeSigningId": “iPhone Developer”,
“appium:updatedWDABundleId": “com.ria.auto.webDriverAgentRunner”,
“appium:showXcodeLog": true
}

@saikrishna321
Copy link
Member

@Stefankoff with inspector currently device-farm doesn't work as there is an open issue on appium-inspector side.

You need to have the wda app trusted on device manually, that's iOS dependency

@Stefankoff
Copy link
Author

Stefankoff commented Oct 8, 2024

@saikrishna321 Thanks, checks the updates on the inspector side.

wda already trusted on both devices, and works fine when device-farm is disabled, so it`s use the wda from xcuitest driver?

So i only need to trust app when i build it from wda-resign?

and from now i need to resing and reload to device-farm my wda-resign every time i update driver?

@Stefankoff
Copy link
Author

@saikrishna321 Thanks for help, and for your work.

But problem with "Use device" is still occurs.

@saikrishna321
Copy link
Member

@Stefankoff please share full logs as gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants