Appium appium1.19.1, xcode12.3, iOS 虚拟机 14.3 版本,运行用例就报错

haha269 · 2021年01月15日 · 最后由 Jayco 回复于 2022年05月17日 · 4958 次阅读

错误
[x]
ft1.1: Traceback (most recent call last):
File "/Users/mango/Downloads/Mis_ios/testsuites/test_06_mis_house.py", line 26, in setUpClass
cls.driver = browse.open_browser(cls)
File "/Users/xxx/Downloads/MangoMis_ios/framework/browser_engine.py", line 38, in open_browser
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
File "/Users/xxx/opt/miniconda3/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 144, in init
proxy
File "/Users/xxx/opt/miniconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "/Users/xxx/opt/miniconda3/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 219, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, parameters)
File "/Users/xxx/opt/miniconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Users/xxx/opt/miniconda3/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
xcodebuild error message:

2021-01-15 15:38:11.530 xcodebuild[26720:448700] WARNING: Failed to load plugin at path: "/Users/xxx/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin", skipping. Error: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Users/xxx/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense): no suitable image found. Did find:
/Users/xxx/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense: code signature in (/Users/mango/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
/Users/xxx/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense: stat() failed with errno=1" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Users/mango/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense, NSDebugDescription=dlopen_preflight(/Users/mango/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense): no suitable image found. Did find:
/Users/xxx/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense: code signature in (/Users/mango/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
/Users/xxx/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin/Contents/MacOS/OMColorSense: stat() failed with errno=1, NSBundlePath=/Users/mango/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin, NSLocalizedDescription=The bundle “OMColorSense” couldn’t be loaded because it is damaged or missing necessary resources.}
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/mango/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp -destination id=F24E8024-C3E2-40DF-A20B-8D2A82183CD1 IPHONEOS_DEPLOYMENT_TARGET=14.3 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO
User defaults from command line:
IDEDerivedDataPathOverride = /Users/mango/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp
Build settings from command line:
COMPILER_INDEX_STORE_ENABLE = NO
GCC_TREAT_WARNINGS_AS_ERRORS = 0
IPHONEOS_DEPLOYMENT_TARGET = 14.3
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Using build description from disk
error: Building for iOS Simulator, but the linked and embedded framework 'YYCache.framework' was built for iOS + iOS Simulator. (in target 'WebDriverAgentLib' from project 'WebDriverAgent')
error: Building for iOS Simulator, but the linked and embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator. (in target 'WebDriverAgentLib' from project 'WebDriverAgent')
error: Building for iOS Simulator, but the embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator. (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
error: Building for iOS Simulator, but the embedded framework 'YYCache.framework' was built for iOS + iOS Simulator. (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
** TEST BUILD FAILED **
2021-01-15 15:38:15.192 xcodebuild[26720:448758] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/mango/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.15_15-38-13-+0800.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-40B2FAF8-9BEA-4592-A47A-5BD90A82E7B9/WebDriverAgentRunner-882AC057-1658-4324-B666-1038C1537AAB/Session-WebDriverAgentRunner-2021-01-15_153815-c2YUYc.log
2021-01-15 15:38:15.193 xcodebuild[26720:448700] [MT] IDETestOperationsObserverDebug: (64EF3AC7-FCCD-4E22-8042-AEC695659A2D) Beginning test session WebDriverAgentRunner-64EF3AC7-FCCD-4E22-8042-AEC695659A2D at 2021-01-15 15:38:15.193 with Xcode 12C33 on target {
SimDevice: iPhone 11 (F24E8024-C3E2-40DF-A20B-8D2A82183CD1, iOS 14.3, Booted)
} (14.3 (18C61))
2021-01-15 15:38:15.376 xcodebuild[26720:448700] [MT] IDETestOperationsObserverDebug: (64EF3AC7-FCCD-4E22-8042-AEC695659A2D) Finished requesting crash reports. Continuing with testing.
2021-01-15 15:38:19.664884+0800 WebDriverAgentRunner-Runner[26724:449050] Running tests...
2021-01-15 15:38:19.679107+0800 WebDriverAgentRunner-Runner[26724:449050] Unable to load configuration data from specified path /; error: 未能打开文件 “iMacSSD - 数据”,因为您没有查看它的权限。
2021-01-15 15:38:19.679319+0800 WebDriverAgentRunner-Runner[26724:449050] XCTRunner Arguments: (
"/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/Containers/Bundle/Application/A6F249A4-A2B1-4274-872E-9206634F17B7/WebDriverAgentRunner-Runner.app/WebDriverAgentRunner-Runner",
"-NSTreatUnknownArgumentsAsOpen",
NO,
"-ApplePersistenceIgnoreState",
YES
)
2021-01-15 15:38:19.679869+0800 WebDriverAgentRunner-Runner[26724:449050] XCTRunner Environment: {
"CA_ASSERT_MAIN_THREAD_TRANSACTIONS" = 0;
"CA_DEBUG_TRANSACTIONS" = 0;
"CFFIXED_USER_HOME" = "/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/Containers/Data/Application/402DB375-FAF8-4C6B-9A59-8DF2C339F4A6";
"CUPS_SERVER" = "/private/tmp/com.apple.launchd.w7Rs1s8smv/Listeners";
"DYLD_FALLBACK_FRAMEWORK_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks";
"DYLD_FALLBACK_LIBRARY_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib";
"DYLD_FRAMEWORK_PATH" = "/Users/xxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/Debug-iphonesimulator";
"DYLD_LIBRARY_PATH" = "/Users/xxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/Debug-iphonesimulator";
"DYLD_ROOT_PATH" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot";
"DYLD_SHARED_CACHE_DIR" = "/Users/xxx/Library/Developer/CoreSimulator/Caches/dyld/19E287/com.apple.CoreSimulator.SimRuntime.iOS-14-3.18C61";
HOME = "/Users/mango/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/Containers/Data/Application/402DB375-FAF8-4C6B-9A59-8DF2C339F4A6";
"IOS_SIMULATOR_SYSLOG_SOCKET" = "/tmp/com.apple.CoreSimulator.SimDevice.F24E8024-C3E2-40DF-A20B-8D2A82183CD1/syslogsock";
"IPHONE_SHARED_RESOURCES_DIRECTORY" = "/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data";
"IPHONE_SIMULATOR_ROOT" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot";
"IPHONE_TVOUT_EXTENDED_PROPERTIES" = "/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/Library/Application Support/Simulator/extended_display.plist";
"LS_ENABLE_BUNDLE_LOCALIZATION_CACHING" = 1;
"MJPEG_SERVER_PORT" = "";
"MTC_CRASH_ON_REPORT" = 1;
NSUnbufferedIO = YES;
"OS_ACTIVITY_DT_MODE" = YES;
PATH = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/sbin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/sbin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/local/bin";
"RWI_LISTEN_SOCKET" = "/private/tmp/com.apple.launchd.j8sk042krQ/com.apple.webinspectord_sim.socket";
"SIMULATOR_ARCHS" = "x86_64";
"SIMULATOR_AUDIO_DEVICES_PLIST_PATH" = "/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/var/run/com.apple.coresimulator.audio.plist";
"SIMULATOR_AUDIO_SETTINGS_PATH" = "/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/var/run/simulatoraudio/audiosettings.plist";
"SIMULATOR_BOOT_TIME" = 1610695678;
"SIMULATOR_CAPABILITIES" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/DeviceTypes/iPhone 11.simdevicetype/Contents/Resources/capabilities.plist";
"SIMULATOR_DEVICE_NAME" = "iPhone 11";
"SIMULATOR_EXTENDED_DISPLAY_PROPERTIES" = "/Users/mango/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/Library/Application Support/Simulator/extended_display.plist";
"SIMULATOR_FRAMEBUFFER_FRAMEWORK" = "/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Resources/Platforms/iphoneos/Library/PrivateFrameworks/SimFramebuffer.framework/SimFramebuffer";
"SIMULATOR_HID_SYSTEM_MANAGER" = "/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Resources/Platforms/iphoneos/Library/Frameworks/SimulatorHID.framework";
"SIMULATOR_HOST_HOME" = "/Users/xxx";
"SIMULATOR_LEGACY_ASSET_SUFFIX" = iphone;
"SIMULATOR_LOG_ROOT" = "/Users/xxx/Library/Logs/CoreSimulator/F24E8024-C3E2-40DF-A20B-8D2A82183CD1";
"SIMULATOR_MAINSCREEN_HEIGHT" = 1792;
"SIMULATOR_MAINSCREEN_PITCH" = "326.000000";
"SIMULATOR_MAINSCREEN_SCALE" = "2.000000";
"SIMULATOR_MAINSCREEN_WIDTH" = 828;
"SIMULATOR_MEMORY_WARNINGS" = "/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/var/run/memory_warning_simulation";
"SIMULATOR_MODEL_IDENTIFIER" = "iPhone12,1";
"SIMULATOR_PRODUCT_CLASS" = N104;
"SIMULATOR_ROOT" = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot";
"SIMULATOR_RUNTIME_BUILD_VERSION" = 18C61;
"SIMULATOR_RUNTIME_VERSION" = "14.3";
"SIMULATOR_SHARED_RESOURCES_DIRECTORY" = "/Users/xxx/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data";
"SIMULATOR_UDID" = "F24E8024-C3E2-40DF-A20B-8D2A82183CD1";
"SIMULATOR_VERSION_INFO" = "CoreSimulator 732.18.6 - Device: iPhone 11 (F24E8024-C3E2-40DF-A20B-8D2A82183CD1) - Runtime: iOS 14.3 (18C61) - DeviceType: iPhone 11";
"SQLITE_ENABLE_THREAD_ASSERTIONS" = 1;
"TESTMANAGERD_REMOTE_AUTOMATION_SIM_SOCK" = "/private/tmp/com.apple.launchd.Dfo3tKpaJ7/com.apple.testmanagerd.remote-automation.unix-domain.socket";
"TESTMANAGERD_SIM_SOCK" = "/private/tmp/com.apple.launchd.kfkraukfZR/com.apple.testmanagerd.unix-domain.socket";
TMPDIR = "/Users/mango/Library/Developer/CoreSimulator/Devices/F24E8024-C3E2-40DF-A20B-8D2A82183CD1/data/Containers/Data/Application/402DB375-FAF8-4C6B-9A59-8DF2C339F4A6/tmp";
"UPGRADE_TIMESTAMP" = 1610684043038;
"USE_PORT" = 8100;
"WDA_PRODUCT_BUNDLE_IDENTIFIER" = "com.facebook.WebDriverAgentRunner";
XCTestBundlePath = "/Users/mango/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest";
XCTestConfigurationFilePath = "";
XCTestSessionIdentifier = "64EF3AC7-FCCD-4E22-8042-AEC695659A2D";
"XPC_FLAGS" = 0x0;
"XPC_SERVICE_NAME" = "UIKitApplication:com.facebook.WebDriverAgentRunner.xctrunner[2df8][rb-legacy]";
"XPC_SIMULATOR_LAUNCHD_NAME" = "com.apple.CoreSimulator.SimDevice.F24E8024-C3E2-40DF-A20B-8D2A82183CD1";
"XCODE_BUILT_PRODUCTS_DIR_PATHS" = "/Users/xxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/Debug-iphonesimulator";
"
XPC_DYLD_FRAMEWORK_PATH" = "/Users/xxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/Debug-iphonesimulator";
"__XPC_DYLD_LIBRARY_PATH" = "/Users/xxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/Debug-iphonesimulator";
}
2021-01-15 15:38:45.570 xcodebuild[26720:448700] [MT] IDETestOperationsObserverDebug: 30.390 elapsed -- Testing started completed.
2021-01-15 15:38:45.570 xcodebuild[26720:448700] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2021-01-15 15:38:45.570 xcodebuild[26720:448700] [MT] IDETestOperationsObserverDebug: 30.390 sec, +30.390 sec -- end
Test session results, code coverage, and logs:
/Users/mango/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.15_15-38-13-+0800.xcresult
Testing failed:
Building for iOS Simulator, but the linked and embedded framework 'YYCache.framework' was built for iOS + iOS Simulator.
Building for iOS Simulator, but the linked and embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator.
Building for iOS Simulator, but the embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator.
Building for iOS Simulator, but the embedded framework 'YYCache.framework' was built for iOS + iOS Simulator.
WebDriverAgentRunner:
WebDriverAgentRunner-Runner.app (26724) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Test runner exited before starting test execution. If you believe this error represents a bug, please attach the result bundle at /Users/mango/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.15_15-38-13-+0800.xcresult))
** TEST EXECUTE FAILED **
Testing started

共收到 7 条回复 时间 点赞

打开 Xcode 选择 Build Settings 搜索 Validate Workspace 设置成 YES 试试看

ltyd5788 回复

刚刚试过 WDA,改成 YES 了 还是不行

下最新版本的 wda,替换现有的,之前的有问题

haha269 回复

那可能记错了, 应该是设置成 NO,试试看,看这个 PR https://github.com/appium/WebDriverAgent/pull/441

ltyd5788 回复

这个只能解决打包失败的问题,但是 1.19.1 不支持 14.3 的系统吧?

XCode12.3 开始,针对类似于 iOS + iOS Simulator 这种多平台的包,强制使用 XCFramework 架构,否则 error

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册