使用 Parallels 运行 Appium Python 自动化。出现错误:[WebDriverAgentMac] Mac2Driver 主机进程已退出,代码为 null,信号 SIGABRT

问题描述 投票:0回答:1

我正在使用 Appium、Python 和新的 Appium Mac2 驱动程序在 macOS(目前为 Sonoma)上自动化桌面应用程序。我已经在我的主机/主计算机上创建了一个工作 POC(概念验证)。我正在尝试在 Parallels 虚拟环境中复制此 POC。

错误:

[WebDriverAgentMac] Mac2Driver host process has exited with code null, signal SIGABRT

*我在网上很多地方都查过这个错误,但都空手而归。 *

我使用什么来实现桌面应用程序自动化:

自动化过程在我的主机上运行良好。在 Parallels VM(共享网络顺便说一句)上设置代码库和依赖项后,一切都很好直到驱动程序启动...

请帮忙! **我已在下面链接了两个 Appium 服务器日志(DEBUG):

*我这个项目的目标是确保设置正常工作,完善自述文件,并开始创建各种 macOS 的一些基本映像/快照,以便其他团队成员可以将它们拉下来并运行应用程序本身的自动化,而无需太多代码设置。 *

automation appium ui-automation parallels python-appium
1个回答
0
投票

我终于找到了我的问题,通过了解如何在 appium python 中启用 show-server-logs,我能够更深入地挖掘。 Ran

xcodebuild -runFirstLaunch
这解决了问题!这是我的驱动程序的代码片段,使用 Python 显示服务器日志:

def Driver()->webdriver.Remote:
  # Variables
  localhost = str(formatForLocalPort(_config['localhost']))
  port = _config.get('port')
  bundle_id = _config.get('bundle_id') # to find the bundle id, from mac terminal, enter: osascript -e 'id of app "AUT"'
  # Appium Options 
  options = Mac2Options()
  options.bundle_id = bundle_id
  options.show_server_logs = True
  url = (f'{localhost}:{port}') 
  driver = webdriver.Remote(url, strict_ssl=False, options=options)
  return driver

这是我启用服务器日志后看到的错误:

2024-02-20 17:17:42:775 [WebDriverAgentMac] [xcodebuild] 2024-02-20 12:17:42.774 xcodebuild[10736:59077] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Library not loaded: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
2024-02-20 17:17:42:775 [WebDriverAgentMac]   Referenced from: <9C6D5AD4-D311-3F49-BCF3-1159133EB0A9> /Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability
2024-02-20 17:17:42:775 [WebDriverAgentMac]   Reason: tried: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file), '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file)" UserInfo={NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Library not loaded: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
2024-02-20 17:17:42:776 [WebDriverAgentMac]   Referenced from: <9C6D5AD4-D311-3F49-BCF3-1159133EB0A9> /Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability
2024-02-20 17:17:42:776 [WebDriverAgentMac]   Reason: tried: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file), '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file), NSBundlePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin, NSLocalizedDescription=The bundle “IDESimulatorAvailability” couldn’t be loaded.}, dyldError = dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0000): Library not loaded: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator
2024-02-20 17:17:42:776 [WebDriverAgentMac]   Referenced from: <9C6D5AD4-D311-3F49-BCF3-1159133EB0A9> /Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability
2024-02-20 17:17:42:776 [WebDriverAgentMac]   Reason: tried: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file), '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator' (no such file)
2024-02-20 17:17:42:776 [WebDriverAgentMac] 
2024-02-20 17:17:42:776 [WebDriverAgentMac] A required plugin failed to load. Please ensure system content is up-to-date — try running 'xcodebuild -runFirstLaunch'.
© www.soinside.com 2019 - 2024. All rights reserved.