Appium Server does not install Webdriveragent app on iOS Simulator

Hello everyone!

Recently, I’m trying to do an automated CI process and I will be using Jenkins, docker and Appium server.
For now I’m going to try to use headless mode on the simulator and start the Appium server in Command-line.

Version Detail as follows:
Mac OS 13.0.1, Xcode 14.1, Appium 1.22.3, Simulator iPhone 12 15.5.

desired_capabilities = {
        "platformName": "iOS",
        "appium:platformVersion": "15.5",
        "appium:deviceName": "iPhone 12",
        "appium:automationName": "XCUITest",
        "appium:uuid": "7682EAAD-2564-411C-A3DF-A529EC18B096",
        "appium:useNewWDA": True,
        "appium:app": "<MY APP PATH>",
        "appium:autoAcceptAlerts": True,
        "appium:autoDismissAlerts": False,
        "appium:locationServicesEnabled": True
    }
    driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_capabilities)
  1. What is different between Appium Server GUI and Appium(I use npm install -g appium)?

Both I did not open from Xcode to modify any of the settings.

I have written some automated test script to test some iOS App and it’s work!
So, I thought I could use cmd to start the Appium Server to run the automated test program again, but it could not install Webdriveragent app with Xcodebuild on Simulator(But Appium Server GUI is work).

  • Appium Server GUI
Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou -destination id=7682EAAD-2564-411C-A3DF-A529EC18B096 IPHONEOS_DEPLOYMENT_TARGET=15.5 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium Server GUI.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent'
  • Appium (npm install -g appium)
Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu -destination id=7682EAAD-2564-411C-A3DF-A529EC18B096 IPHONEOS_DEPLOYMENT_TARGET=15.5 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent'

log:

[Xcode] ld: cannot link directly with dylib/framework, your binary is not an allowed client of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework/XCTAutomationSupport for architecture x86_64
[Xcode] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[Xcode]
[Xcode]
[Xcode] ** TEST BUILD FAILED **
[Xcode]
[Xcode]
[Xcode] The following build commands failed:
[Xcode] 	Ld /Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Build/Products/Debug-iphonesimulator/WebDriverAgentLib.framework/WebDriverAgentLib normal (in target 'WebDriverAgentLib' from project 'WebDriverAgent')
[Xcode] (1 failure)
[Xcode]
[Xcode] 2022-12-22 16:15:16.104 xcodebuild[34014:145466] [MT] IDETestOperationsObserverDebug: 0.008 elapsed -- Testing started completed.
[Xcode]
[Xcode] 2022-12-22 16:15:16.104 xcodebuild[34014:145466] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
[Xcode] 2022-12-22 16:15:16.104 xcodebuild[34014:145466] [MT] IDETestOperationsObserverDebug: 0.008 sec, +0.008 sec -- end
[Xcode]
[Xcode]
[Xcode] Test session results, code coverage, and logs:
[Xcode] 	/Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Logs/Test/Test-WebDriverAgentRunner-2022.12.22_16-15-15-+0800.xcresult
[Xcode]
[Xcode]
[Xcode] Testing failed:
[Xcode] 	Cannot link directly with dylib/framework, your binary is not an allowed client of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework/XCTAutomationSupport for architecture x86_64
[Xcode] 	Test target WebDriverAgentRunner encountered an error (The bundle identifier for WebDriverAgentRunner-Runner.app couldn’t be read. The application may be damaged or incomplete: “/Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app”.)
[Xcode]
[Xcode] ** TEST EXECUTE FAILED **
[Xcode]
[Xcode]
[Xcode] Testing started
[Xcode]
[WebDriverAgent] xcodebuild exited with code '65' and signal 'null'
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1671696916255
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [XCUITest] xcodebuild error message:
[debug] [XCUITest]
[debug] [XCUITest] Command line invocation:
[debug] [XCUITest]
[debug] [XCUITest] /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu -destination id=7682EAAD-2564-411C-A3DF-A529EC18B096 IPHONEOS_DEPLOYMENT_TARGET=15.5 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO
[debug] [XCUITest] User defaults from command line:
[debug] [XCUITest]     IDEDerivedDataPathOverride = /Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu
[debug] [XCUITest]     IDEPackageSupportUseBuiltinSCM = YES
[debug] [XCUITest] Build settings from command line:
[debug] [XCUITest]     COMPILER_INDEX_STORE_ENABLE = NO
[debug] [XCUITest]     GCC_TREAT_WARNINGS_AS_ERRORS = 0
[debug] [XCUITest]     IPHONEOS_DEPLOYMENT_TARGET = 15.5
[debug] [XCUITest] Prepare packages
[debug] [XCUITest] Computing target dependency graph and provisioning inputs
[debug] [XCUITest] Create build description
[debug] [XCUITest] Build description signature: b94e56456d6381f3ae3694498cc44005
[debug] [XCUITest] Build description path: /Users/jackson/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Build/Intermediates.noindex/XCBuildData/b94e56456d6381f3ae3694498cc44005-desc.xcbuild
[debug] [XCUITest] note: Building targets in dependency order
[debug] [XCUITest] Analyze /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgentLib/Vendor/CocoaHTTPServer/HTTPConnection.m normal x86_64 (in target 'WebDriverAgentLib' from project 'WebDriverAgent')

I tried to move to individual folder in cmd and do xcodebuild WebDriverAgent.xcodeproj directly, apparently only Appium Server GUI can install Webdriveragent APP.

  1. Is there any way to start Appium Server through cmd?
    because I want to start a docker container to run the appium server.

BTW, I have tried to install Appium 2.0, but xcode will pop up some error message when I run an automation test script, So I give up use Appium 2.0 LOL.

Hmmm I would recommend you use Appium 2.0 and let’s see the error message. Would you mind capturing it?

Can you show us your appium doctor result as well?

Also, check this Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code ‘65’ on iPad

You won’t be able to make Appium 1 work with Xcode 14+

Hi All Am still stuck with xcode build error 65, what is the solution