XcodesOrg / XcodesOrg/xcodes

Crashes when using iOS 13/14 runtimes

Open
#295 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
4.8k
Forks
182
Avg merge
2d 12h
Merged PRs (30d)
1

Description

I've looked but haven't been able to find these issues referenced anywhere.

I'm migrating from xcversion to xcodes because of https://github.com/xcpretty/xcode-install/issues/466.
Unfortunately I'm running into lots of issues with the iOS 13 and 14 runtimes. iOS 12 works properly.

I've seen 2 different issues in CI:

Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 14.5.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/Frameworks/StoreKitTest.framework/StoreKitTest
  Reason: Incompatible library version: StoreKitTest requires version 1.0.0 or later, but XCTest provides version 0.0.0))
Process spawn via launchd failed.
xctest encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/distiller/purchases-ios/fastlane/test_output/xctest/ios/RevenueCat.xcresult. (Underlying Error: Process spawn via launchd failed. Bad file descriptor. (Underlying Error: The operation couldn't be completed. (Mach error 9 - (os/kern) memory failure))))

And this when testing locally:

2023-06-02 13:59:04.682639-0700 UnitTestsHostApp[55076:18788661] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSXPCInterfaceProxy_ASDOctaneServiceProtocol setStringValue:forIdentifier:forBundleID:completion:]: unrecognized selector sent to instance 0x6000015ba120'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001803f61fc __exceptionPreprocess + 236
	1   libobjc.A.dylib                     0x000000018016a438 objc_exception_throw + 56
	2   CoreFoundation                      0x00000001804054c4 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
	3   CoreFoundation                      0x00000001803fa45c ___forwarding___ + 1408
	4   CoreFoundation                      0x00000001803fc42c _CF_forwarding_prep_0 + 92
	5   StoreKitTest                        0x0000000103769674 -[SKTestSession _setStringValue:forIdentifier:error:] + 252
	6   StoreKitTest                        0x0000000103767e58 -[SKTestSession setLocale:] + 72

All pointing to StoreKitTest somehow being corrupted.

Repro steps:

(You can use https://github.com/RevenueCat/purchases-ios but I'm sure this reproduces with any other project, probably using StoreKitTest)

  • sudo xcodes runtimes install "iOS 14.5"
  • xcrun simctl list to find a simulator for the newly installed runtime
  • xcodebuild -workspace ./RevenueCat.xcworkspace -scheme RevenueCat -configuration Debug -destination 'platform=iOS Simulator,id=SIMULATOR_ID' -testPlan 'CI-AllTests' build test

I'm able to reproduce this in CI (CircleCI), locally on command line, but interestingly enough also when running tests with Xcode on a simulator created from that runtime.

Installing the runtime directly from Xcode does work properly, so I'm very puzzled as to what's wrong with these runtimes installed through xcodes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with sudo xcodes runtimes install "iOS 14.5", then use xcrun simctl list and the provided xcodebuild command against the installed runtime. Compare the failing runtime with one installed directly from Xcode, focusing on the StoreKitTest and XCTest errors. Done means iOS 13/14 runtimes installed through xcodes can run the same tests without these failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.