Hi,
I am new to Apple development in general and iOS development in particular.
I've been trying to run UI tests on the simulators (15.0-15.5). When I run them on a physical device (iPhone), all tests work fine. When I run them on simulators, simulators randomly crash.
Additionally, when I click "erase all contents and settings for the simulator, sometimes it happens very fast (~20 seconds) and sometimes it takes hours and fails to complete. For example, right now iPhone 13 15.5 simulator is stuck erasing. I launched Console tool to capture simulator's error output, and it's spamming this endlessly:
https://imgur.com/xPEBRvi
Almost everything plastered with:
**
CoreSimulatorBridge (Foundation)
**
Attempted to decode a collection type 'NSString' (subclass of 'NSObject') for key 'NS.keys'. 'NSString' requires its subclasses to be explicitly added to the allowed classes list but it is not present. Allowing this has been a source of security issues. Please ensure you meant this type to be in archives: 'NSString' (0x1da9e91d8) [/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]
and
*** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSString' (0x1da9e91d8) [/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework]' for key 'NS.keys', even though it was not explicitly included in the client allowed classes set: '{( "'NSDictionary' (0x1da9c5060) [/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CoreFoundation.framework]" )}'. This will be disallowed in the future.
Occasionally sprinkled in:
Unrecognized token received from com.apple.fileprovider.extension.push
from apsd
I tried reinstalling XCode, I tried a clean install by looking up the [list of folders](Uninstall xcode 10 | Apple Developer Forums) online and manually deleting whatever of the following was present on my system:
_/Applications/Xcode.app ~/Library/Caches/com.apple.dt.Xcode ~/Library/Developer ~/Library/MobileDevice ~/Library/Preferences/com.apple.dt.Xcode.plist /Library/Preferences/com.apple.dt.Xcode.plist /System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom /System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist /System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom /System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist _
etc. (why doesn't Apple have uninstaller to do all this automatically for a complete clean uninstall??)
I tried deleting and reinstalling the simulators.
I tried different versions of Xcode (14.5.1, 15, 15.1). Nothing helps. I would appreciate any pointers on how to troubleshoot these simulator crashes and slow resets.
Thank you