appium / WebDriverAgent

A WebDriver server for iOS and tvOS
Other
1.2k stars 377 forks source link

Runtime error when build with Xcode 15 #817

Closed El-hombre-del-fuego closed 10 months ago

El-hombre-del-fuego commented 10 months ago

I can build and install IntegrationApp and WebDriverAgentRunner-Runner with Xcode 15. But when I run a test, I get following error:

_uncaughtException: Cannot read properties of undefined (reading '_callChannel')
TypeError: Cannot read properties of undefined (reading '_callChannel')
    at startExecuting (/Users/andreas/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-ios-device/lib/xctest.js:199:39)
    at Timeout._onTimeout (/Users/andreas/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-ios-device/lib/xctest.js:205:34)
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)_

This happens on iOS 16 and 17.

KazuCocoa commented 10 months ago

How did you start the instance? At least https://appium.github.io/appium-xcuitest-driver/5.11/run-preinstalled-wda/ should not work for iOS 17.

Note This method does not work for iOS 17/tvOS 17 environment for now due to platform changes. Please use the xcodebuild method.

Possibly this is Xcode 15 env..?

El-hombre-del-fuego commented 10 months ago

Yes it's Xcode 15. And yes, I start with "appium:usePreinstalledWDA": true

KazuCocoa commented 10 months ago

Perhaps duplicate of https://github.com/appium/appium/issues/19206 (so closing this itself)

My local did not have the issue when I ran a session with iOS 16 and Xcode 15 in the github issue, but some Xcode 15 environments might have communication issues for non-iOS 17.

El-hombre-del-fuego commented 10 months ago

I build with Xcode 15 IntegrationApp, WebDriverAgentLib and WebDriverAgentRunner on my real iPhone 12 (iOS 17). Without errors > all good.

Then I start appium server local and run with appium inspector: { "appium:deviceName": "iPhone von Andreas", "platformName": "iOS", "appium:platformVersion": "17.0", "appium:udid": "00008101-XXXXXXXXXXXXXXXXXXX", "appium:noReset": false, "appium:updatedWDABundleId": "at.handyparken.WebDriverAgentRunner", "appium:usePreinstalledWDA": false, "appium:wdaLaunchTimeout": 120000, "appium:automationName": "XCUITest", "appium:showXcodeLog": true }

appium.log

Then I get this error from appium inspector: Failed to create session. An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70 xcodebuild error message: Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build-for-testing test-without-building -project /Users/andreas/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/andreas/Library/Developer/Xcode/DerivedData/WebDriverAgent-hcxcoazuwnrlnxemwnkavjpmhjtl -destination id=00008101-000658503484001E IPHONEOS_DEPLOYMENT_TARGET=17.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO User defaults from command line: IDEDerivedDataPathOverride = /Users/andreas/Library/Developer/Xcode/DerivedData/WebDriverAgent-hcxcoazuwnrlnxemwnkavjpmhjtl IDEPackageSupportUseBuiltinSCM = YES Build settings from command line: COMPILER_INDEX_STORE_ENABLE = NO GCC_TREAT_WARNINGS_AS_ERRORS = 0 IPHONEOS_DEPLOYMENT_TARGET = 17.0 Prepare packages ComputeTargetDependencyGraph note: Building targets in dependency order note: Target dependency graph (2 targets) Target 'WebDriverAgentRunner' in project 'WebDriverAgent' ➜ Explicit dependency on target 'WebDriverAgentLib' in project 'WebDriverAgent' Target 'WebDriverAgentLib' in project

KazuCocoa commented 10 months ago

What error do you see when you run the xcodebuild like /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build-for-testing test-without-building -project /Users/andreas/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/andreas/Library/Developer/Xcode/DerivedData/WebDriverAgent-hcxcoazuwnrlnxemwnkavjpmhjtl -destination id=00008101-000658503484001E IPHONEOS_DEPLOYMENT_TARGET=17.0 GCC_TREAT_WARNINGS_AS_ERRORS=0?

We observed Apple's xcodebuild command did not detect the device properly, while Xcode 15 did. This was not via Appium, xcodebuild command internal thing, so there was nothing we could do. https://github.com/appium/appium/issues/19381

El-hombre-del-fuego commented 10 months ago

I get this error: /Users/andreas/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj: error: Signing for "WebDriverAgentRunner" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'WebDriverAgentRunner' from project 'WebDriverAgent') 2023-12-06 10:16:57.401 xcodebuild[4554:102483] Writing error result bundle to /var/folders/kl/wc99p9jx0gs2ttyht1065p2r0000gp/T/ResultBundle_2023-06-12_10-16-0057.xcresult xcodebuild: error: Failed writing xctestrun file: The folder “WebDriverAgentRunner_iphoneos17.0-arm64.xctestrun” doesn’t exist..