I got the same error while building WebDriverAgent
My device:
Mac mini with M1 chip (OS 13 beta)
Xcode 14 Official
iPhone SE 2020 (iOS 16 Official)
This is my error when building using terminal
Testing failed:
Cannot link directly with dylib/framework, your binary is not an allowed client of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework/XCTAutomationSupport for architecture arm64
Testing cancelled because the build failed.
** TEST FAILED **
The following build commands failed:
Ld /Users/macmi034/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/WebDriverAgentLib normal (in target 'WebDriverAgentLib' from project 'WebDriverAgent')
(1 failure)