Using Parallels to run Appium Python automation. Getting error: [WebDriverAgentMac] Mac2Driver host process has exited with code null, signal SIGABRT

30 views Asked by At

I'm automating desktop applications on macOS ( Sonoma at the moment ) using Appium, Python, and the new Appium Mac2 Driver. I have created a working POC ( Proof of Concept ) on my host/primary machine. I'm attempting to duplicate this POC within a Parallels virtual environment.

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

*I've looked in many places online about this error but came up empty handed. *

What I'm using to accomplish desktop app automation:

The automation process works fine on my host. After setting up the codebase and dependencies on the Parallels VM ( Shared Network btw ), all is well right up until the point where the driver is starting...

Please help! **I've linked both of the Appium server logs ( DEBUG ) below:

*My goal with this project is to ensure the setup is working, iron out a README, and start creating some base images/snapshots of various macOS so that other teammates can pull them down and run automations of the application themselves, without much code setup. *

1

There are 1 answers

0
Austin On

I finally found my issue, by finding out how to enable show-server-logs in appium python, I was able to dig deeper. Ran xcodebuild -runFirstLaunch and this fixed the issue! Here is a code snippet for my Driver, showing server logs using 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

Here is the error I was seeing after I enabled server logs:

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'.