Detox icon indicating copy to clipboard operation
Detox copied to clipboard

xcode 14: com.apple.springboard crash trying to foreground the app

Open Peter-Cumming opened this issue 3 years ago • 12 comments

What happened?

Xcode14.0.0 BETA-4; iPadOS16

I am testing an iPad App using the Xcode14 BETA against a Detox Testing Framework.

All tests that require foregrounding the app are crashing consistently when attempting to foreground the app with the command: /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard

It looks like the issue is caused within device.sendToHome() method which Send(s) application to background by bringing com.apple.springboard to the foreground .

ChildProcessError: Command failed: /sr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5) :
The request to open "com.apple.springboard" failed.
Unexpected error type.
Underlying error (domain=BSServiceConnectionErrorDomain, code=3) :
The operation couldn't be completed. XPC error received on message reply handler
XPC error received on message reply handler
"/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.sprinaboard'
(exited with error code 5)

I also received an error message stating You can't use this version of the application "SpringBoard" with this version of macOS.

When I tested against XCode14 BETA-4 the same tests consistently crash. Crash log:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: A2909BAA-E2AC-4E86-AF3D-EF071350665D
CrashReporter Key:   6A03D217-0E76-65A1-A52B-93E98DD1918F
Hardware Model:      MacBookPro18,2
Process:             SpringBoard [13334]
Path:                /Applications/Xcode-14.0.0-Beta.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app/SpringBoard
Identifier:          com.apple.springboard
Version:             1.0 (50)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [13330]
Coalition:           com.apple.CoreSimulator.SimDevice.091E1685-48CC-4D6A-A049-896D552BBF55 [2660]
Responsible Process: SimulatorTrampoline [7907]

Date/Time:           2022-08-04 15:14:14.8419 +0100
Launch Time:         2022-08-04 15:13:35.5505 +0100
OS Version:          macOS 12.5 (21G72)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	       0x18040c84c __exceptionPreprocess + 160
1   libobjc.A.dylib               	       0x18005131c objc_exception_throw + 56
2   Foundation                    	       0x180b09108 _userInfoForFileAndLine + 0
3   SpringBoardHome               	       0x1041deba8 -[SBHIconModel applicationIconForBundleIdentifier:] + 236
4   SpringBoard                   	       0x1058b19c4 -[SBIconModel applicationIconForBundleIdentifier:] + 44
5   SpringBoard                   	       0x105947094 -[SBMainWorkspace _handleOpenApplicationRequest:options:activationSettings:origin:withResult:] + 5776
6   BaseBoard                     	       0x1832eca68 -[BSEventQueue _processNextEvent] + 208
7   BaseBoard                     	       0x1832ecd4c -[BSEventQueue executeOrInsertEvents:atPosition:] + 464
8   FrontBoard                    	       0x18a738cc0 -[FBWorkspaceEventQueue executeOrAppendEvent:] + 104
9   SpringBoard                   	       0x1059496e0 -[SBMainWorkspace _handleTrustedOpenRequestForApplication:options:activationSettings:origin:withResult:] + 640
10  SpringBoard                   	       0x1058ea918 -[SBMainWorkspace systemService:handleOpenApplicationRequest:withCompletion:] + 1004
11  FrontBoard                    	       0x18a71bd48 -[FBSystemService _reallyActivateApplication:requestID:options:source:originalSource:isTrusted:sequenceNumber:cacheGUID:ourSequenceNumber:ourCacheGUID:withResult:] + 1076

What was the expected behaviour?

Once the Detox connection has registered, applesimutils has identified the device and booted the simulator. The app should be terminated and then successfully uninstalled. Once confirmed the app should be installed and the tests run.

[EXEC_CMD, 0] - List simulator devices by Type [EXEC_CMD, 1] - List simulator devices by ID [EXEC_CMD, 2] - Terminate the app running on the device [EXEC_CMD, 3] - Uninstall the app running on the device [EXEC_CMD, 4] - Install the app on the device [EXEC_CMD, 5] - Launch the app [EXEC_CMD, 6] - Background the app

The app should be foregrounded and the test continues to validate the app behaviour.

Was it tested on latest Detox?

  • [X] I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: "19.7.1" React Native version: "0.67.4" Node version: 16.13.2 Device model: "iPad Pro (12.9-inch) (5th generation)" iOS version: iPadOS16 macOS version: Monterey 12.5 Xcode version: Xcode14.0.0 BETA-4 Test-runner: jest-circus

Detox logs

Detox logs
peter.cumming@HUD040089 ios % yarn e2e-run backgrounding.e2e.ts -t 'Continues to work if Goldstone quits while PRODUCT is backgrounded' --loglevel trace
➤ YN0000: executing [e2e-run]: detox test -l verbose --record-logs failing --take-screenshots failing --record-videos failing --configuration ios
16:49:55.389 detox[17221] INFO:  [test.js] DETOX_CONFIGURATION="ios" DETOX_LOGLEVEL="trace" DETOX_RECORD_LOGS="failing" DETOX_RECORD_VIDEOS="failing" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1659628195385 DETOX_TAKE_SCREENSHOTS="failing" DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern 'Continues to work if Goldstone quits while PRODUCT is backgrounded' --maxWorkers 1 backgrounding.e2e.ts
watchman warning:  Recrawled this watch 1 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile' ; watchman watch-project '/Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile'`

16:49:56.757 detox[17223] TRACE: [DETOX_CREATE] created a Detox instance with config:
{
  appsConfig: {
    default: {
      type: 'ios.app',
      binaryPath: './ios/build/Build/Products/Debug-iphonesimulator/PRODUCT.app',
      build: 'cd ios && xcodebuild -workspace PRODUCT.xcworkspace -scheme PRODUCT -configuration Debug -sdk iphonesimulator -derivedDataPath build'
    }
  },
  artifactsConfig: {
    rootDir: 'artifacts/ios.2022-08-04 15-49-55Z',
    plugins: {
      log: {
        enabled: true,
        keepOnlyFailedTestsArtifacts: true
...
16:50:00.719 detox[17223] TRACE: [ARTIFACT_START] starting SimulatorLogRecording
16:50:00.724 detox[17223] DEBUG: [SPAWN_CMD, #6, cpid=17267] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact
16:50:00.776 detox[17223] TRACE: [ARTIFACT_START] starting SimulatorScreenshot
16:50:00.776 detox[17223] DEBUG: [EXEC_CMD, #7] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 screenshot "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/dd9c9127-34d0-4280-a098-336ab873f892.detox.png"
16:50:00.780 detox[17223] TRACE: [ARTIFACT_START] starting SimulatorVideoRecording
16:50:00.782 detox[17223] DEBUG: [SPAWN_CMD, #8, cpid=17269] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 recordVideo /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/13f75ed4-cb8f-4eb0-b8fb-12a28d94648a.detox.mp4
16:50:01.393 detox[17223] TRACE: [SPAWN_STDERR, #8, cpid=17269] Recording started

16:50:01.582 detox[17223] TRACE: [EXEC_SUCCESS, #7] Detected file type 'PNG' from extension
Wrote screenshot to: /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/dd9c9127-34d0-4280-a098-336ab873f892.detox.png

16:50:01.582 detox[17223] TRACE: [ARTIFACT_STOP] stopping SimulatorScreenshot
16:50:01.583 detox[17223] INFO:  at e2e/goldstone/utils.ts:153:19 
 Stopping Goldstone server
16:50:01.583 detox[17223] INFO:  at e2e/goldstone/utils.ts:95:19 
 Starting Goldstone server
16:50:01.671 detox[17223] INFO:  at node_modules/@COMPANY/goldstone/dist/src/server.js:40:44 
 Server ready at http://localhost:15742/.
16:50:01.685 detox[17223] INFO:  at e2e/goldstone/utils.ts:468:19 
 Adding session: {"id":"video-backgrounding-304-id","name":"video-backgrounding-304","deviceId":"video-backgrounding-304-device","deviceName":"video-backgrounding-304-device","permissions":{"teamIds":["t1"]},"timeline":{"timelineId":"timeline1","startTime":"2021-05-01T10:32:32.000Z"}}
16:50:01.691 detox[17223] INFO:  at e2e/goldstone/utils.ts:357:19 
 Setting recording status 1 for session video-backgrounding-304-id
16:50:01.703 detox[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({
  deviceId: '091E1685-48CC-4D6A-A049-896D552BBF55',
  bundleId: 'com.COMPANY.PRODUCT'
})
16:50:01.704 detox[17223] DEBUG: [EXEC_CMD, #9] /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:50:01.704 detox[17223] DEBUG: [EXEC_TRY, #9] Terminating com.COMPANY.PRODUCT...
16:50:02.811 detox[17223] TRACE: [EXEC_TRY_FAIL, #9] An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate

16:50:02.812 detox[17223] DEBUG: [EXEC_TRY, #9] Terminating com.COMPANY.PRODUCT...
16:50:02.907 detox[17223] DEBUG: [EXEC_FAIL, #9] "/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT" failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate
 `/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT` (exited with error code 3) (code=3), stdout and stderr:

16:50:02.907 detox[17223] DEBUG: [EXEC_FAIL, #9] 
16:50:02.907 detox[17223] DEBUG: [EXEC_FAIL, #9] An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate

16:50:02.908 detox[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({
  deviceId: '091E1685-48CC-4D6A-A049-896D552BBF55',
  bundleId: 'com.COMPANY.PRODUCT'
})
16:50:02.908 detox[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeLaunchApp({
  bundleId: 'com.COMPANY.PRODUCT',
  deviceId: '091E1685-48CC-4D6A-A049-896D552BBF55',
  launchArgs: {
    detoxServer: 'ws://localhost:57820',
    detoxSessionId: 'd50869c0-c570-3190-f3d8-ec4b71b561e4',
    isAutomatedTest: true,
    reduxState: '{"reports":{"entities":{},"ids":[],"activeActionInstanceIds":[]},"config":{"coachTagLeadTime":10,"coachTagLagTime":10},"clips":{"entities":{},"ids":[]},"groups":{"entities":{},"ids":[]},"instances":{"entities":{},"ids":[]},"playlists":{"entities":{},"ids":[]},"video":{"videos":{},"isFullscreen":false,"isInstanceViewer":false,"duration":0,"context":{}},"devices":{"freeGB":null,"selfStatus":null,"totalGB":null},"network":{"displayName":null,"hostName":null,"ipAddress":null,"networkName":null,"supportsMulticast":false},"sessions":{"sessions":[]},"user":{"isCheckingUsagePrivilege":false,"userId":"123","username":"[email protected]","isSystemAdmin":false,"adminMode":false,"firstName":"Belgium","lastName":"TheBest","featurePrivileges":[464],"teamIds":["t1"]},"goldstones":{"items":[]},"_persist":{"rehydrated":true,"version":23}}',
    reduxPersistVersion: null
  }
})
16:50:02.908 detox[17223] TRACE: [ARTIFACT_START] starting SimulatorLogRecording {
  udid: '091E1685-48CC-4D6A-A049-896D552BBF55',
  bundleId: 'com.COMPANY.PRODUCT'
}
16:50:02.909 detox[17223] TRACE: [ARTIFACT_STOP] stopping SimulatorLogRecording
16:50:02.961 detox[17267] TRACE: [SPAWN_KILL] sending SIGINT to: /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact
16:50:02.967 detox[17223] DEBUG: [SPAWN_END, #6, cpid=17267] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact exited with code #0
16:50:02.968 detox[17223] DEBUG: [EXEC_CMD, #10] /usr/bin/xcrun simctl get_app_container 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:50:03.073 detox[17223] TRACE: [EXEC_SUCCESS, #10] /Users/peter.cumming/Library/Developer/CoreSimulator/Devices/091E1685-48CC-4D6A-A049-896D552BBF55/data/Containers/Bundle/Application/A1C7572E-3D4B-48DE-BFA3-803D41576E05/PRODUCT.app

16:50:03.076 detox[17223] DEBUG: [SPAWN_CMD, #11, cpid=17289] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/peter.cumming/Library/Developer/CoreSimulator/Devices/091E1685-48CC-4D6A-A049-896D552BBF55/data/Containers/Bundle/Application/A1C7572E-3D4B-48DE-BFA3-803D41576E05/PRODUCT.app\""
16:50:03.128 detox[17223] DEBUG: [EXEC_CMD, #12] SIMCTL_CHILD_GULGeneratedClassDisposeDisabled=YES SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/peter.cumming/Library/Detox/ios/6326dfb28ac56e8a9df8af3137dc3004f2436f0c/Detox.framework/Detox" /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT --args -detoxServer ws://localhost:57820 -detoxSessionId d50869c0-c570-3190-f3d8-ec4b71b561e4 -isAutomatedTest true -reduxState '{"reports":{"entities":{},"ids":[],"activeActionInstanceIds":[]},"config":{"coachTagLeadTime":10,"coachTagLagTime":10},"clips":{"entities":{},"ids":[]},"groups":{"entities":{},"ids":[]},"instances":{"entities":{},"ids":[]},"playlists":{"entities":{},"ids":[]},"video":{"videos":{},"isFullscreen":false,"isInstanceViewer":false,"duration":0,"context":{}},"devices":{"freeGB":null,"selfStatus":null,"totalGB":null},"network":{"displayName":null,"hostName":null,"ipAddress":null,"networkName":null,"supportsMulticast":false},"sessions":{"sessions":[]},"user":{"isCheckingUsagePrivilege":false,"userId":"123","username":"[email protected]","isSystemAdmin":false,"adminMode":false,"firstName":"Belgium","lastName":"TheBest","featurePrivileges":[464],"teamIds":["t1"]},"goldstones":{"items":[]},"_persist":{"rehydrated":true,"version":23}}' -reduxPersistVersion null -detoxDebugVisibility YES -detoxDisableHierarchyDump YES
16:50:03.128 detox[17223] DEBUG: [EXEC_TRY, #12] Launching com.COMPANY.PRODUCT...
16:50:03.349 detox[17223] TRACE: [EXEC_SUCCESS, #12] com.COMPANY.PRODUCT: 17297

16:50:03.350 detox[17223] DEBUG: [EXEC_CMD, #13] /usr/bin/xcrun simctl get_app_container 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:50:03.468 detox[17223] TRACE: [EXEC_SUCCESS, #13] /Users/peter.cumming/Library/Developer/CoreSimulator/Devices/091E1685-48CC-4D6A-A049-896D552BBF55/data/Containers/Bundle/Application/A1C7572E-3D4B-48DE-BFA3-803D41576E05/PRODUCT.app

16:50:03.475 detox[17223] INFO:  [AppleSimUtils.js] com.COMPANY.PRODUCT launched. To watch simulator logs, run:
        /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact --predicate 'process == "PRODUCT"'
16:50:03.475 detox[17297] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onLaunchApp({
  bundleId: 'com.COMPANY.PRODUCT',
  deviceId: '091E1685-48CC-4D6A-A049-896D552BBF55',
  launchArgs: {
    detoxServer: 'ws://localhost:57820',
    detoxSessionId: 'd50869c0-c570-3190-f3d8-ec4b71b561e4',
    isAutomatedTest: true,
    reduxState: '{"reports":{"entities":{},"ids":[],"activeActionInstanceIds":[]},"config":{"coachTagLeadTime":10,"coachTagLagTime":10},"clips":{"entities":{},"ids":[]},"groups":{"entities":{},"ids":[]},"instances":{"entities":{},"ids":[]},"playlists":{"entities":{},"ids":[]},"video":{"videos":{},"isFullscreen":false,"isInstanceViewer":false,"duration":0,"context":{}},"devices":{"freeGB":null,"selfStatus":null,"totalGB":null},"network":{"displayName":null,"hostName":null,"ipAddress":null,"networkName":null,"supportsMulticast":false},"sessions":{"sessions":[]},"user":{"isCheckingUsagePrivilege":false,"userId":"123","username":"[email protected]","isSystemAdmin":false,"adminMode":false,"firstName":"Belgium","lastName":"TheBest","featurePrivileges":[464],"teamIds":["t1"]},"goldstones":{"items":[]},"_persist":{"rehydrated":true,"version":23}}',
    reduxPersistVersion: null,
    detoxDebugVisibility: 'YES',
    detoxDisableHierarchyDump: 'YES'
  },
  pid: 17297
})
16:50:03.696 detox[17223] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-304-id
16:50:04.026 detox[17223] DEBUG: [WSS_CONNECTION, #57921] registered a new connection.
16:50:04.236 detox[17223] TRACE: [WSS_GET_FROM, #57921] {"type":"login","params":{"role":"app","sessionId":"d50869c0-c570-3190-f3d8-ec4b71b561e4"},"messageId":0}
16:50:04.236 detox[17223] TRACE: [WSS_SEND_TO, #app] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":true},"messageId":0}
16:50:04.237 detox[17223] TRACE: [SESSION_JOINED] app joined session d50869c0-c570-3190-f3d8-ec4b71b561e4
16:50:04.237 detox[17223] TRACE: [WSS_SEND_TO, #tester] {"type":"appConnected"}
16:50:04.238 detox[17223] TRACE: [WS_MESSAGE] {"type":"appConnected"}
 
16:50:04.239 detox[17223] TRACE: [WS_SEND] {"type":"isReady","params":{},"messageId":-1000}
16:50:04.239 detox[17223] TRACE: [WSS_GET_FROM, #tester] {"type":"isReady","params":{},"messageId":-1000}
16:50:04.239 detox[17223] TRACE: [WSS_SEND_TO, #app] {"type":"isReady","params":{},"messageId":-1000}
16:50:05.697 detox[17223] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-304-id
16:50:07.699 detox[17223] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-304-id
16:50:07.860 detox[17223] TRACE: [WSS_GET_FROM, #app] {"type":"ready","params":{},"messageId":-1000}
16:50:07.862 detox[17223] TRACE: [WSS_SEND_TO, #tester] {"type":"ready","params":{},"messageId":-1000}
16:50:07.863 detox[17223] TRACE: [WS_MESSAGE] {"type":"ready","params":{},"messageId":-1000}
 
16:50:07.865 detox[17223] TRACE: [WS_SEND] {"type":"waitForActive","params":{},"messageId":1}
16:50:07.865 detox[17223] TRACE: [WSS_GET_FROM, #tester] {"type":"waitForActive","params":{},"messageId":1}
16:50:07.865 detox[17223] TRACE: [WSS_SEND_TO, #app] {"type":"waitForActive","params":{},"messageId":1}
16:50:07.866 detox[17223] TRACE: [WSS_GET_FROM, #app] {"type":"ready","params":{},"messageId":-1000}
16:50:07.866 detox[17223] TRACE: [WSS_SEND_TO, #tester] {"type":"ready","params":{},"messageId":-1000}
16:50:07.866 detox[17223] TRACE: [WS_MESSAGE] {"type":"ready","params":{},"messageId":-1000}
 
16:50:07.867 detox[17223] TRACE: [WSS_GET_FROM, #app] {"type":"ready","params":{},"messageId":-1000}
16:50:07.867 detox[17223] TRACE: [WSS_SEND_TO, #tester] {"type":"ready","params":{},"messageId":-1000}
16:50:07.867 detox[17223] TRACE: [WS_MESSAGE] {"type":"ready","params":{},"messageId":-1000}
 
16:50:07.867 detox[17223] TRACE: [WSS_GET_FROM, #app] {"messageId":1,"type":"waitForActiveDone","params":{}}
16:50:07.868 detox[17223] TRACE: [WSS_SEND_TO, #tester] {"messageId":1,"type":"waitForActiveDone","params":{}}
16:50:07.868 detox[17223] TRACE: [WS_MESSAGE] {"messageId":1,"type":"waitForActiveDone","params":{}}
 
16:50:07.868 detox[17297] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onAppReady({
  deviceId: '091E1685-48CC-4D6A-A049-896D552BBF55',
  bundleId: 'com.COMPANY.PRODUCT',
  pid: 17297
})
16:50:07.872 detox[17223] DEBUG: [EXEC_CMD, #14] /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
 ...
 Sending heartbeat to video-backgrounding-304-id
16:51:11.735 detox[17223] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-304-id
16:51:13.363 detox[17223] ERROR: [EXEC_FAIL, #14] "/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard" failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
The request to open "com.apple.springboard" failed.
Unexpected error type.
Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
	The operation couldn’t be completed. XPC error received on message reply handler
	XPC error received on message reply handler
 `/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard` (exited with error code 5) (code=5), stdout and stderr:

16:51:13.363 detox[17223] ERROR: [EXEC_FAIL, #14] 
16:51:13.363 detox[17223] ERROR: [EXEC_FAIL, #14] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
The request to open "com.apple.springboard" failed.
Unexpected error type.
Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
	The operation couldn’t be completed. XPC error received on message reply handler
	XPC error received on message reply handler

16:51:13.372 detox[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTestFnFailure({
  error: ChildProcessError: Command failed: /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
  An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
  The request to open "com.apple.springboard" failed.
  Unexpected error type.
  Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
  	The operation couldn’t be completed. XPC error received on message reply handler
  	XPC error received on message reply handler
   `/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard` (exited with error code 5)
      at callback (/Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile/node_modules/child-process-promise/lib/index.js:33:27)
      at ChildProcess.exithandler (node:child_process:404:5)
      at ChildProcess.emit (node:events:394:28)
      at ChildProcess.emit (node:domain:470:12)
      at maybeClose (node:internal/child_process:1067:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
    code: 5,
    childProcess: {
      _forkChild: [Function: _forkChild],
      ChildProcess: [Function: ChildProcess],
      exec: [Function: exec],
      execFile: [Function: execFile],
      execFileSync: [Function: execFileSync],
      execSync: [Function: execSync],
      fork: [Function: fork],
      spawn: [Function: spawn],
      spawnSync: [Function: spawnSync]
    },
    stdout: '',
    stderr: 'An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):\n' +
      'The request to open "com.apple.springboard" failed.\n' +
      'Unexpected error type.\n' +
      'Underlying error (domain=BSServiceConnectionErrorDomain, code=3):\n' +
      '\tThe operation couldn’t be completed. XPC error received on message reply handler\n' +
      '\tXPC error received on message reply handler\n'
  }
})
16:51:13.372 detox[17223] TRACE: [ARTIFACT_START] starting SimulatorScreenshot
16:51:13.372 detox[17223] DEBUG: [EXEC_CMD, #15] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 screenshot "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/1a93d0d7-ab17-4939-a65e-80302225b520.detox.png"
16:51:13.593 detox[17223] TRACE: [EXEC_SUCCESS, #15] Detected file type 'PNG' from extension
Wrote screenshot to: /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/1a93d0d7-ab17-4939-a65e-80302225b520.detox.png

16:51:13.593 detox[17223] TRACE: [ARTIFACT_STOP] stopping SimulatorScreenshot
16:51:13.594 detox[17223] TRACE: [DETOX_AFTER_EACH] failed test: "HRHS-1948: PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded"
16:51:13.594 detox[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTestDone({
  title: 'Continues to work if Goldstone quits while PRODUCT is backgrounded',
  fullName: 'HRHS-1948: PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded',
  status: 'failed',
  invocations: 1,
  timedOut: false
})
16:51:13.594 detox[17223] TRACE: [ARTIFACT_START] starting SimulatorScreenshot
16:51:13.594 detox[17223] DEBUG: [EXEC_CMD, #16] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 screenshot "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/300599b5-08ab-413d-b705-a77ef9107557.detox.png"
16:51:13.598 detox[17223] TRACE: [ARTIFACT_STOP] stopping SimulatorVideoRecording
16:51:13.599 detox[17269] TRACE: [SPAWN_KILL] sending SIGINT to: /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 recordVideo /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/13f75ed4-cb8f-4eb0-b8fb-12a28d94648a.detox.mp4
16:51:13.619 detox[17223] TRACE: [SPAWN_STDOUT, #8, cpid=17269] 
Wrote video to: /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/13f75ed4-cb8f-4eb0-b8fb-12a28d94648a.detox.mp4

16:51:13.621 detox[17223] DEBUG: [SPAWN_END, #8, cpid=17269] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 recordVideo /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/13f75ed4-cb8f-4eb0-b8fb-12a28d94648a.detox.mp4 exited with code #0
16:51:13.622 detox[17223] TRACE: [ARTIFACT_SAVE] saving SimulatorVideoRecording to: artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/test.mp4
16:51:13.622 detox[17223] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/13f75ed4-cb8f-4eb0-b8fb-12a28d94648a.detox.mp4" to artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/test.mp4
16:51:13.737 detox[17223] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-304-id
16:51:13.827 detox[17223] TRACE: [EXEC_SUCCESS, #16] Detected file type 'PNG' from extension
Wrote screenshot to: /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/300599b5-08ab-413d-b705-a77ef9107557.detox.png

16:51:13.827 detox[17223] TRACE: [ARTIFACT_STOP] stopping SimulatorScreenshot
16:51:13.828 detox[17223] TRACE: [ARTIFACT_STOP] stopping SimulatorLogRecording
16:51:13.828 detox[17223] TRACE: [ARTIFACT_SAVE] saving SimulatorScreenshot to: artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testStart.png
16:51:13.828 detox[17223] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/dd9c9127-34d0-4280-a098-336ab873f892.detox.png" to artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testStart.png
16:51:13.829 detox[17223] TRACE: [ARTIFACT_SAVE] saving SimulatorScreenshot to: artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testFnFailure.png
16:51:13.829 detox[17223] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/1a93d0d7-ab17-4939-a65e-80302225b520.detox.png" to artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testFnFailure.png
16:51:13.830 detox[17223] TRACE: [ARTIFACT_SAVE] saving SimulatorScreenshot to: artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testDone.png
16:51:13.831 detox[17223] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/300599b5-08ab-413d-b705-a77ef9107557.detox.png" to artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testDone.png
16:51:13.880 detox[17289] TRACE: [SPAWN_KILL] sending SIGINT to: /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact --predicate processImagePath beginsWith "/Users/peter.cumming/Library/Developer/CoreSimulator/Devices/091E1685-48CC-4D6A-A049-896D552BBF55/data/Containers/Bundle/Application/A1C7572E-3D4B-48DE-BFA3-803D41576E05/PRODUCT.app"
16:51:13.884 detox[17223] DEBUG: [SPAWN_END, #11, cpid=17289] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/peter.cumming/Library/Developer/CoreSimulator/Devices/091E1685-48CC-4D6A-A049-896D552BBF55/data/Containers/Bundle/Application/A1C7572E-3D4B-48DE-BFA3-803D41576E05/PRODUCT.app\"" exited with code #0
16:51:13.885 detox[17223] INFO:  HRHS-1948: PRODUCT crashes when foregrounded: Continues to work if Goldstone quits while PRODUCT is backgrounded [FAIL]
16:51:13.885 HRHS-1948: PRODUCT crashes when foregrounded[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'HRHS-1948: PRODUCT crashes when foregrounded' })

16:51:13.885 ROOT_DESCRIBE_BLOCK[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'ROOT_DESCRIBE_BLOCK' })
16:51:13.898 detox[17223] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeCleanup()
16:51:13.898 detox[17223] TRACE: [ARTIFACT_SAVE] saving SimulatorLogRecording to: artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/device.log
16:51:13.899 detox[17223] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/38afe26e-cb7b-4053-b4fe-c90592abd360.detox.log" to artifacts/ios.2022-08-04 15-49-55Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/device.log
16:51:13.901 detox[17223] TRACE: [ARTIFACT_START] starting FileArtifact
16:51:13.901 detox[17223] TRACE: [ARTIFACT_STOP] stopping FileArtifact
16:51:13.901 detox[17223] TRACE: [ARTIFACT_SAVE] saving FileArtifact to: artifacts/ios.2022-08-04 15-49-55Z/detox_pid_17223.json.log { append: true }
16:51:13.901 detox[17223] TRACE: [ARTIFACT_START] starting FileArtifact
16:51:13.901 detox[17223] TRACE: [ARTIFACT_STOP] stopping FileArtifact
16:51:13.901 detox[17223] TRACE: [ARTIFACT_SAVE] saving FileArtifact to: artifacts/ios.2022-08-04 15-49-55Z/detox_pid_17223.log { append: true }
16:51:13.901 detox[17223] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/3762af4a-ded2-48e0-8a0c-1d31ce440484.detox.log" to artifacts/ios.2022-08-04 15-49-55Z/detox_pid_17223.json.log
16:51:13.901 detox[17223] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/b08c696b-16f1-4afa-988a-b7eeba36b946.detox.log" to artifacts/ios.2022-08-04 15-49-55Z/detox_pid_17223.log
16:51:13.905 detox[17223] TRACE: [WS_SEND] {"type":"cleanup","params":{"stopRunner":true},"messageId":-49642}
16:51:13.906 detox[17223] TRACE: [WSS_GET_FROM, #tester] {"type":"cleanup","params":{"stopRunner":true},"messageId":-49642}
16:51:13.906 detox[17223] TRACE: [WSS_SEND_TO, #app] {"type":"cleanup","params":{"stopRunner":true},"messageId":-49642}
16:51:13.907 detox[17223] TRACE: [WSS_GET_FROM, #app] {"messageId":-49642,"params":{},"type":"cleanupDone"}
16:51:13.907 detox[17223] TRACE: [WSS_SEND_TO, #tester] {"messageId":-49642,"params":{},"type":"cleanupDone"}
16:51:13.907 detox[17223] TRACE: [WS_MESSAGE] {"messageId":-49642,"params":{},"type":"cleanupDone"}
 
16:51:13.913 detox[17223] DEBUG: [EXEC_CMD, #17] /usr/bin/xcrun simctl shutdown 091E1685-48CC-4D6A-A049-896D552BBF55
16:51:13.913 detox[17223] DEBUG: [EXEC_TRY, #17] Shutting down 091E1685-48CC-4D6A-A049-896D552BBF55...
16:51:13.921 detox[17223] TRACE: [SESSION_TORN] tester exited session d50869c0-c570-3190-f3d8-ec4b71b561e4
16:51:13.921 detox[17223] TRACE: [WSS_SEND_TO, #app] {"type":"testerDisconnected","messageId":-1}
16:51:14.151 detox[17223] TRACE: [SESSION_TORN] app exited session d50869c0-c570-3190-f3d8-ec4b71b561e4
16:51:14.886 detox[17223] DEBUG: [EXEC_SUCCESS, #17] 091E1685-48CC-4D6A-A049-896D552BBF55 shut down
16:51:14.887 detox[17223] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully
 FAIL  e2e/tests/backgrounding.e2e.ts (78.375s)
  HRHS-2267: Can discover new sessions created on existing Goldstone while PRODUCT is backgrounded
    ○ skipped discovers sessions upon foregrounding
  HRHS-2258: Cannot discover Goldstones while PRODUCT is backgrounded
    ○ skipped discovers sessions upon foregrounding
  HRHS-1948: PRODUCT crashes when foregrounded
    ✕ Continues to work if Goldstone quits while PRODUCT is backgrounded (72875ms)

  ● HRHS-1948: PRODUCT crashes when foregrounded › Continues to work if Goldstone quits while PRODUCT is backgrounded

    ChildProcessError: Command failed: /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
    An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
    The request to open "com.apple.springboard" failed.
    Unexpected error type.
    Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
    	The operation couldn’t be completed. XPC error received on message reply handler
    	XPC error received on message reply handler
     `/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard` (exited with error code 5)

      at callback (../node_modules/child-process-promise/lib/index.js:33:27)

Device logs

Device logs
peter.cumming@HUD040089 ios % yarn e2e-run backgrounding.e2e.ts -t 'Continues to work if Goldstone quits while PRODUCT is backgrounded' --record-logs all
➤ YN0000: executing [e2e-run]: detox test -l verbose --record-logs failing --take-screenshots failing --record-videos failing --configuration ios
16:58:20.624 detox[17543] INFO:  [test.js] DETOX_CONFIGURATION="ios" DETOX_LOGLEVEL="verbose" DETOX_RECORD_LOGS="all" DETOX_RECORD_VIDEOS="failing" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1659628700621 DETOX_TAKE_SCREENSHOTS="failing" DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern 'Continues to work if Goldstone quits while PRODUCT is backgrounded' --maxWorkers 1 backgrounding.e2e.ts
watchman warning:  Recrawled this watch 1 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile' ; watchman watch-project '/Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile'`

16:58:22.096 detox[17544] DEBUG: [WSS_CREATE] Detox server listening on localhost:58727...
16:58:22.338 detox[17544] DEBUG: [WSS_CONNECTION, #58728] registered a new connection.
16:58:22.604 detox[17544] DEBUG: [EXEC_CMD, #0] applesimutils --list --byType "iPad Pro (12.9-inch) (5th generation)"
16:58:22.786 detox[17544] DEBUG: [EXEC_CMD, #1] applesimutils --list --byId 091E1685-48CC-4D6A-A049-896D552BBF55 --maxResults 1
16:58:22.887 detox[17544] DEBUG: [EXEC_CMD, #2] /usr/bin/xcrun simctl boot 091E1685-48CC-4D6A-A049-896D552BBF55 
16:58:22.887 detox[17544] DEBUG: [EXEC_TRY, #2] Booting device 091E1685-48CC-4D6A-A049-896D552BBF55...
16:58:23.357 detox[17544] DEBUG: [EXEC_CMD, #3] /usr/bin/xcrun simctl bootstatus 091E1685-48CC-4D6A-A049-896D552BBF55
16:58:26.929 detox[17544] DEBUG: [EXEC_CMD, #4] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 screenshot "/dev/null"
16:58:27.787 detox[17544] DEBUG: [EXEC_CMD, #5] /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:58:27.787 detox[17544] DEBUG: [EXEC_TRY, #5] Terminating com.COMPANY.PRODUCT...
16:58:28.910 detox[17544] DEBUG: [EXEC_TRY, #5] Terminating com.COMPANY.PRODUCT...
16:58:29.144 detox[17544] DEBUG: [EXEC_FAIL, #5] "/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT" failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate
 `/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT` (exited with error code 3) (code=3), stdout and stderr:

16:58:29.144 detox[17544] DEBUG: [EXEC_FAIL, #5] 
16:58:29.144 detox[17544] DEBUG: [EXEC_FAIL, #5] An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate

16:58:29.145 detox[17544] DEBUG: [EXEC_CMD, #6] /usr/bin/xcrun simctl uninstall 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:58:29.145 detox[17544] DEBUG: [EXEC_TRY, #6] Uninstalling com.COMPANY.PRODUCT...
16:58:29.693 detox[17544] DEBUG: [EXEC_SUCCESS, #6] com.COMPANY.PRODUCT uninstalled
16:58:29.694 detox[17544] DEBUG: [EXEC_CMD, #7] /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:58:29.694 detox[17544] DEBUG: [EXEC_TRY, #7] Terminating com.COMPANY.PRODUCT...
16:58:30.908 detox[17544] DEBUG: [EXEC_TRY, #7] Terminating com.COMPANY.PRODUCT...
16:58:31.042 detox[17544] DEBUG: [EXEC_FAIL, #7] "/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT" failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate
 `/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT` (exited with error code 3) (code=3), stdout and stderr:

16:58:31.042 detox[17544] DEBUG: [EXEC_FAIL, #7] 
16:58:31.042 detox[17544] DEBUG: [EXEC_FAIL, #7] An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate

16:58:31.043 detox[17544] DEBUG: [EXEC_CMD, #8] /usr/bin/xcrun simctl install 091E1685-48CC-4D6A-A049-896D552BBF55 "/Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile/ios/build/Build/Products/Debug-iphonesimulator/PRODUCT.app"
16:58:31.043 detox[17544] DEBUG: [EXEC_TRY, #8] Installing /Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile/ios/build/Build/Products/Debug-iphonesimulator/PRODUCT.app...
16:58:32.051 detox[17544] DEBUG: [EXEC_SUCCESS, #8] /Users/peter.cumming/COMPANY_Repos/PRODUCT-mobile/ios/build/Build/Products/Debug-iphonesimulator/PRODUCT.app installed
16:58:33.764 detox[17544] INFO:  HRHS-2267: Can discover new sessions created on existing Goldstone while PRODUCT is backgrounded is assigned to 091E1685-48CC-4D6A-A049-896D552BBF55 (iPad Pro (12.9-inch) (5th generation))
16:58:33.765 detox[17544] INFO:  HRHS-2267: Can discover new sessions created on existing Goldstone while PRODUCT is backgrounded: discovers sessions upon foregrounding
16:58:33.765 detox[17544] INFO:  HRHS-2267: Can discover new sessions created on existing Goldstone while PRODUCT is backgrounded: discovers sessions upon foregrounding [SKIPPED]

16:58:33.765 detox[17544] INFO:  HRHS-2258: Cannot discover Goldstones while PRODUCT is backgrounded is assigned to 091E1685-48CC-4D6A-A049-896D552BBF55 (iPad Pro (12.9-inch) (5th generation))
16:58:33.765 detox[17544] INFO:  HRHS-2258: Cannot discover Goldstones while PRODUCT is backgrounded: discovers sessions upon foregrounding
16:58:33.765 detox[17544] INFO:  HRHS-2258: Cannot discover Goldstones while PRODUCT is backgrounded: discovers sessions upon foregrounding [SKIPPED]

16:58:33.765 detox[17544] INFO:  HRHS-1948: PRODUCT crashes when foregrounded is assigned to 091E1685-48CC-4D6A-A049-896D552BBF55 (iPad Pro (12.9-inch) (5th generation))
16:58:33.766 detox[17544] INFO:  HRHS-1948: PRODUCT crashes when foregrounded: Continues to work if Goldstone quits while PRODUCT is backgrounded
16:58:34.355 detox[17544] DEBUG: [SPAWN_CMD, #9, cpid=17770] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact
16:58:34.408 detox[17544] DEBUG: [EXEC_CMD, #10] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 screenshot "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/94db1eba-98cb-4470-bb14-1b6dec50a932.detox.png"
16:58:34.415 detox[17544] DEBUG: [SPAWN_CMD, #11, cpid=17774] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 recordVideo /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/0db7cc58-8f48-42f8-abcb-e97d32956cba.detox.mp4
16:58:34.871 detox[17544] INFO:  at e2e/goldstone/utils.ts:153:19 
 Stopping Goldstone server
16:58:34.871 detox[17544] INFO:  at e2e/goldstone/utils.ts:95:19 
 Starting Goldstone server
16:58:35.379 detox[17544] INFO:  at node_modules/@COMPANY/goldstone/dist/src/server.js:40:44 
 Server ready at http://localhost:15698/.
16:58:35.400 detox[17544] INFO:  at e2e/goldstone/utils.ts:468:19 
 Adding session: {"id":"video-backgrounding-44-id","name":"video-backgrounding-44","deviceId":"video-backgrounding-44-device","deviceName":"video-backgrounding-44-device","permissions":{"teamIds":["t1"]},"timeline":{"timelineId":"timeline1","startTime":"2021-05-01T10:32:32.000Z"}}
16:58:35.406 detox[17544] INFO:  at e2e/goldstone/utils.ts:357:19 
 Setting recording status 1 for session video-backgrounding-44-id
16:58:35.420 detox[17544] DEBUG: [EXEC_CMD, #12] /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:58:35.421 detox[17544] DEBUG: [EXEC_TRY, #12] Terminating com.COMPANY.PRODUCT...
16:58:36.525 detox[17544] DEBUG: [EXEC_TRY, #12] Terminating com.COMPANY.PRODUCT...
16:58:36.629 detox[17544] DEBUG: [EXEC_FAIL, #12] "/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT" failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate
 `/usr/bin/xcrun simctl terminate 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT` (exited with error code 3) (code=3), stdout and stderr:

16:58:36.629 detox[17544] DEBUG: [EXEC_FAIL, #12] 
16:58:36.629 detox[17544] DEBUG: [EXEC_FAIL, #12] An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
The operation couldn’t be completed. found nothing to terminate
found nothing to terminate

16:58:36.686 detox[17544] DEBUG: [SPAWN_END, #9, cpid=17770] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact exited with code #0
16:58:36.687 detox[17544] DEBUG: [EXEC_CMD, #13] /usr/bin/xcrun simctl get_app_container 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:58:36.844 detox[17544] DEBUG: [SPAWN_CMD, #14, cpid=17791] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/peter.cumming/Library/Developer/CoreSimulator/Devices/091E1685-48CC-4D6A-A049-896D552BBF55/data/Containers/Bundle/Application/A8461F16-B696-4440-A257-5A52AF286A02/PRODUCT.app\""
16:58:36.896 detox[17544] DEBUG: [EXEC_CMD, #15] SIMCTL_CHILD_GULGeneratedClassDisposeDisabled=YES SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/peter.cumming/Library/Detox/ios/6326dfb28ac56e8a9df8af3137dc3004f2436f0c/Detox.framework/Detox" /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT --args -detoxServer ws://localhost:58727 -detoxSessionId ec334f08-5c1c-0055-5da9-0702c80fbaf2 -isAutomatedTest true -reduxState '{"reports":{"entities":{},"ids":[],"activeActionInstanceIds":[]},"config":{"coachTagLeadTime":10,"coachTagLagTime":10},"clips":{"entities":{},"ids":[]},"groups":{"entities":{},"ids":[]},"instances":{"entities":{},"ids":[]},"playlists":{"entities":{},"ids":[]},"video":{"videos":{},"isFullscreen":false,"isInstanceViewer":false,"duration":0,"context":{}},"devices":{"freeGB":null,"selfStatus":null,"totalGB":null},"network":{"displayName":null,"hostName":null,"ipAddress":null,"networkName":null,"supportsMulticast":false},"sessions":{"sessions":[]},"user":{"isCheckingUsagePrivilege":false,"userId":"123","username":"[email protected]","isSystemAdmin":false,"adminMode":false,"firstName":"Belgium","lastName":"TheBest","featurePrivileges":[464],"teamIds":["t1"]},"goldstones":{"items":[]},"_persist":{"rehydrated":true,"version":23}}' -reduxPersistVersion null -detoxDebugVisibility YES -detoxDisableHierarchyDump YES
16:58:36.896 detox[17544] DEBUG: [EXEC_TRY, #15] Launching com.COMPANY.PRODUCT...
16:58:37.411 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:37.512 detox[17544] DEBUG: [EXEC_CMD, #16] /usr/bin/xcrun simctl get_app_container 091E1685-48CC-4D6A-A049-896D552BBF55 com.COMPANY.PRODUCT
16:58:37.646 detox[17544] INFO:  [AppleSimUtils.js] com.COMPANY.PRODUCT launched. To watch simulator logs, run:
        /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact --predicate 'process == "PRODUCT"'
16:58:38.184 detox[17544] DEBUG: [WSS_CONNECTION, #58953] registered a new connection.
16:58:39.415 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:41.413 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:41.937 detox[17544] DEBUG: [EXEC_CMD, #17] /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
16:58:43.414 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:45.413 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:47.414 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:49.415 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:51.417 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:53.419 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:55.420 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:57.421 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:58:59.422 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:01.424 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:03.424 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:05.424 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:07.426 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:09.427 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:11.427 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:13.428 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:15.429 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:17.429 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:19.429 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:21.431 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:23.431 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:25.433 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:27.433 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:29.435 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:31.435 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:33.435 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:35.436 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:37.437 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:39.438 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:41.439 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:43.440 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:45.441 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:47.290 detox[17544] ERROR: [EXEC_FAIL, #17] "/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard" failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
The request to open "com.apple.springboard" failed.
Unexpected error type.
Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
	The operation couldn’t be completed. XPC error received on message reply handler
	XPC error received on message reply handler
 `/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard` (exited with error code 5) (code=5), stdout and stderr:

16:59:47.290 detox[17544] ERROR: [EXEC_FAIL, #17] 
16:59:47.290 detox[17544] ERROR: [EXEC_FAIL, #17] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
The request to open "com.apple.springboard" failed.
Unexpected error type.
Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
	The operation couldn’t be completed. XPC error received on message reply handler
	XPC error received on message reply handler

16:59:47.296 detox[17544] DEBUG: [EXEC_CMD, #18] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 screenshot "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/5aff03da-96c0-4619-833e-99b874390fae.detox.png"
16:59:47.442 detox[17544] INFO:  at e2e/goldstone/utils.ts:394:19 
 Sending heartbeat to video-backgrounding-44-id
16:59:47.514 detox[17544] DEBUG: [EXEC_CMD, #19] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 screenshot "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/4fb71be6-9d75-460b-94d8-8325ffd39c8d.detox.png"
16:59:47.583 detox[17544] DEBUG: [SPAWN_END, #11, cpid=17774] /usr/bin/xcrun simctl io 091E1685-48CC-4D6A-A049-896D552BBF55 recordVideo /private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/0db7cc58-8f48-42f8-abcb-e97d32956cba.detox.mp4 exited with code #0
16:59:47.586 detox[17544] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/0db7cc58-8f48-42f8-abcb-e97d32956cba.detox.mp4" to artifacts/ios.2022-08-04 15-58-20Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/test.mp4
16:59:47.750 detox[17544] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/94db1eba-98cb-4470-bb14-1b6dec50a932.detox.png" to artifacts/ios.2022-08-04 15-58-20Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testStart.png
16:59:47.750 detox[17544] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/5aff03da-96c0-4619-833e-99b874390fae.detox.png" to artifacts/ios.2022-08-04 15-58-20Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testFnFailure.png
16:59:47.751 detox[17544] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/4fb71be6-9d75-460b-94d8-8325ffd39c8d.detox.png" to artifacts/ios.2022-08-04 15-58-20Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/testDone.png
16:59:47.805 detox[17544] DEBUG: [SPAWN_END, #14, cpid=17791] /usr/bin/xcrun simctl spawn 091E1685-48CC-4D6A-A049-896D552BBF55 log stream --level debug --style compact --predicate "processImagePath beginsWith \"/Users/peter.cumming/Library/Developer/CoreSimulator/Devices/091E1685-48CC-4D6A-A049-896D552BBF55/data/Containers/Bundle/Application/A8461F16-B696-4440-A257-5A52AF286A02/PRODUCT.app\"" exited with code #0
16:59:47.806 detox[17544] INFO:  HRHS-1948: PRODUCT crashes when foregrounded: Continues to work if Goldstone quits while PRODUCT is backgrounded [FAIL]

16:59:47.814 detox[17544] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/015b9e2b-45eb-4299-b3b5-4a7baee753f5.detox.log" to artifacts/ios.2022-08-04 15-58-20Z/✗ HRHS-1948_ PRODUCT crashes when foregrounded Continues to work if Goldstone quits while PRODUCT is backgrounded/device.log
16:59:47.815 detox[17544] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/5a44b4ce-bd3a-475a-9cca-c94e9b06cc31.detox.log" to artifacts/ios.2022-08-04 15-58-20Z/detox_pid_17544.json.log
16:59:47.815 detox[17544] DEBUG: [MOVE_FILE] moving "/private/var/folders/n4/hcp3g49n21g75w5pk8_trwvwmk1krd/T/27048b09-97ed-4959-afad-223dfedd7e4c.detox.log" to artifacts/ios.2022-08-04 15-58-20Z/detox_pid_17544.log
16:59:47.826 detox[17544] DEBUG: [EXEC_CMD, #20] /usr/bin/xcrun simctl shutdown 091E1685-48CC-4D6A-A049-896D552BBF55
16:59:47.826 detox[17544] DEBUG: [EXEC_TRY, #20] Shutting down 091E1685-48CC-4D6A-A049-896D552BBF55...
16:59:48.815 detox[17544] DEBUG: [EXEC_SUCCESS, #20] 091E1685-48CC-4D6A-A049-896D552BBF55 shut down
16:59:48.815 detox[17544] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully
 FAIL  e2e/tests/backgrounding.e2e.ts (86.955s)
  HRHS-2267: Can discover new sessions created on existing Goldstone while PRODUCT is backgrounded
    ○ skipped discovers sessions upon foregrounding
  HRHS-2258: Cannot discover Goldstones while PRODUCT is backgrounded
    ○ skipped discovers sessions upon foregrounding
  HRHS-1948: PRODUCT crashes when foregrounded
    ✕ Continues to work if Goldstone quits while PRODUCT is backgrounded (73747ms)

  ● HRHS-1948: PRODUCT crashes when foregrounded › Continues to work if Goldstone quits while PRODUCT is backgrounded

    ChildProcessError: Command failed: /usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard
    An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
    The request to open "com.apple.springboard" failed.
    Unexpected error type.
    Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
    	The operation couldn’t be completed. XPC error received on message reply handler
    	XPC error received on message reply handler
     `/usr/bin/xcrun simctl launch 091E1685-48CC-4D6A-A049-896D552BBF55 com.apple.springboard` (exited with error code 5)

      at callback (../node_modules/child-process-promise/lib/index.js:33:27)

More data, please!


<img width="1261" alt="Screenshot 2022-08-04 at 17 14 46" src="https://user-images.githubusercontent.com/12497755/182897875-e18b322b-0405-4965-9f96-e3de4031e7ff.png">
Screenshot 2022-08-04 at 16 50 57 Screenshot 2022-08-04 at 16 52 08 Screenshot 2022-08-04 at 16 52 01 Screenshot 2022-08-04 at 16 52 53

Peter-Cumming avatar Aug 04 '22 16:08 Peter-Cumming

Hey @Peter-Cumming, thanks for the report. Looks like an issue with Apple's simctl tool. I will take a closer look on that today. Does it work on older versions of Xcode? Is that a new error you're getting?

asafkorem avatar Aug 07 '22 07:08 asafkorem

@asafkorem mind the Xcode14.0.0 BETA-4 in the description.

d4vidi avatar Aug 07 '22 08:08 d4vidi

Hey @Peter-Cumming, thanks for the report. Looks like an issue with Apple's simctl tool. I will take a closer look on that today. Does it work on older versions of Xcode? Is that a new error you're getting?

👋🏼 Hey @asafkorem the tests run just fine in XCode 13.2.1.

Peter-Cumming avatar Aug 11 '22 16:08 Peter-Cumming

I figured. I actually planned to download Xcode 14 beta to explore it a bit today but I won’t make it before Sunday..

asafkorem avatar Aug 11 '22 17:08 asafkorem

Added to backlog, targeting our next iteration.

d4vidi avatar Aug 11 '22 20:08 d4vidi

Added to backlog, targeting our next iteration.

Hey @d4vidi , do you have any expectation when the next iteration is likely to land?

Peter-Cumming avatar Aug 24 '22 14:08 Peter-Cumming

XCode 14 was released today. We are running into this as well now.

systemride avatar Sep 12 '22 22:09 systemride

FYI this seems to only be an issue with ios16 simulators. By setting our device query to use the 15.5 sim we are able to work around. i.e.

device: {
  type: "iPhone SE (3rd generation)",
  os: "iOS 15.5"
}

andrewlmurray avatar Sep 13 '22 00:09 andrewlmurray

Launching springboard via simctl seems to be an issue now - you can crash your sim by running

/usr/bin/xcrun simctl launch "your-device-uuid" com.apple.springboard

andrewlmurray avatar Sep 13 '22 00:09 andrewlmurray

Thanks for the reports, I'm checking this issue with Xcode 14.

asafkorem avatar Sep 13 '22 22:09 asafkorem

Launching springboard via simctl seems to be an issue now - you can crash your sim by running

/usr/bin/xcrun simctl launch "your-device-uuid" com.apple.springboard

Interesting.. Putting it together with what I already suspected, it might be related to the case where the Simulator isn't booted in GUI mode (with the Simulator app opened).. But that's only my immediate suspicion

asafkorem avatar Sep 13 '22 22:09 asafkorem

I'm able to reproduce this issue, that's definitely an simctl issue, which fails to launch the Springboard even when running with Simulator on GUI mode. See: https://user-images.githubusercontent.com/55082339/190343189-9e85542e-f919-4451-bccc-4ecf63551d60.png

I'll try to figure whether there's any alternative for that.

asafkorem avatar Sep 15 '22 07:09 asafkorem

I'm getting the same issue:

SpringBoard quit unexpectedly.
Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.

Any chance to fix it?

mabeljarsdel avatar Sep 22 '22 18:09 mabeljarsdel

Not closed yet, I'm about to release a patch version with the fix (merged in https://github.com/wix/Detox/pull/3609) very soon.

asafkorem avatar Sep 28 '22 12:09 asafkorem

Detox v19.12.2 has been released with the fix, upgrading Detox to the latest version will solve this crash.

asafkorem avatar Sep 28 '22 13:09 asafkorem

@asafkorem Thank you for all the hard work. However, I am seeing a crash in "Preferences" now. This might be directly related to your fix as you are terminating the Settings app?

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 4F542227-E1FF-43C8-927E-DAC462B871B8
CrashReporter Key:   BB1EFCB7-8E0A-3FAC-BB8E-CBC20EBB4167
Hardware Model:      Macmini7,1
Process:             Preferences [82404]
Path:                /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications/Preferences.app/Preferences
Identifier:          com.apple.Preferences
Version:             1 (1161.1)
Code Type:           X86-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [81794]
Coalition:           com.apple.CoreSimulator.SimDevice.A92AA438-64BD-4B6B-A34F-525EE4B42001 [128484]
Responsible Process: SimulatorTrampoline [46469]

Date/Time:           2022-09-30 12:43:04.9988 +0200
Launch Time:         2022-09-30 12:42:55.6921 +0200
OS Version:          macOS 12.6 (21G115)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[application<com.apple.Preferences>:82404] failed to terminate gracefully after 5.0s
ProcessVisibility: Foreground
ProcessState: Running
WatchdogEvent: process-exit
WatchdogVisibility: Foreground
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 14.390 (user 9.420, system 4.970), 51% CPU",
"Elapsed application CPU time (seconds): 4.109, 15% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff833de108a kevent_qos + 10
1   libdispatch.dylib             	       0x107f6a0cd _dispatch_kq_poll + 113
2   libdispatch.dylib             	       0x107f69d8f _dispatch_kq_drain + 267
3   libdispatch.dylib             	       0x107f696f8 _dispatch_event_loop_poke + 185
4   libdispatch.dylib             	       0x107f5f1c8 dispatch_after + 547
5   AXCoreUtilities               	       0x111cf0c68 AXPerformBlockOnMainThreadAfterDelay + 104
6   AccessibilityUtilities        	       0x1528f6f67 _axmonitor_dyld_image_callback + 199
7   dyld_sim                      	       0x103111ac5 invocation function for block in dyld4::APIs::_dyld_register_func_for_add_image(void (*)(mach_header const*, long)) + 175
8   dyld_sim                      	       0x1030f1e75 dyld4::RuntimeState::withLoadersReadLock(void () block_pointer) + 47
9   dyld_sim                      	       0x103111920 dyld4::APIs::_dyld_register_func_for_add_image(void (*)(mach_header const*, long)) + 112
10  AccessibilityUtilities        	       0x1528f6e8c __23-[AXBinaryMonitor init]_block_invoke + 28
11  libdispatch.dylib             	       0x107f447fb _dispatch_call_block_and_release + 12
12  libdispatch.dylib             	       0x107f45a3a _dispatch_client_callout + 8
13  libdispatch.dylib             	       0x107f5532c _dispatch_main_queue_drain + 1338
14  libdispatch.dylib             	       0x107f54de4 _dispatch_main_queue_callback_4CF + 31
15  CoreFoundation                	       0x1066529f7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
16  CoreFoundation                	       0x10664d3c6 __CFRunLoopRun + 2482
17  CoreFoundation                	       0x10664c637 CFRunLoopRunSpecific + 560
18  GraphicsServices              	       0x10f65828a GSEventRunModal + 139
19  UIKitCore                     	       0x11b04e425 -[UIApplication _run] + 994
20  UIKitCore                     	       0x11b053301 UIApplicationMain + 123
21  Preferences                   	       0x102ea4c38 0x102e9a000 + 44088
22  dyld_sim                      	       0x1030ee2bf start_sim + 10
23  dyld                          	       0x10774a52e start + 462

danilobuerger avatar Sep 30 '22 12:09 danilobuerger

@danilobuerger thanks for this report. We are on vacation until around October 19th. We will pick it up then.

d4vidi avatar Oct 06 '22 14:10 d4vidi

Detox v19.12.2 has been released with the fix, upgrading Detox to the latest version will solve this crash.

Great work thanks @asafkorem 👍🏼

Peter-Cumming avatar Oct 11 '22 16:10 Peter-Cumming

@asafkorem Thank you for all the hard work. However, I am seeing a crash in "Preferences" now. This might be directly related to your fix as you are terminating the Settings app?

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 4F542227-E1FF-43C8-927E-DAC462B871B8
CrashReporter Key:   BB1EFCB7-8E0A-3FAC-BB8E-CBC20EBB4167
Hardware Model:      Macmini7,1
Process:             Preferences [82404]
Path:                /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications/Preferences.app/Preferences
Identifier:          com.apple.Preferences
Version:             1 (1161.1)
Code Type:           X86-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [81794]
Coalition:           com.apple.CoreSimulator.SimDevice.A92AA438-64BD-4B6B-A34F-525EE4B42001 [128484]
Responsible Process: SimulatorTrampoline [46469]

Date/Time:           2022-09-30 12:43:04.9988 +0200
Launch Time:         2022-09-30 12:42:55.6921 +0200
OS Version:          macOS 12.6 (21G115)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[application<com.apple.Preferences>:82404] failed to terminate gracefully after 5.0s
ProcessVisibility: Foreground
ProcessState: Running
WatchdogEvent: process-exit
WatchdogVisibility: Foreground
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 14.390 (user 9.420, system 4.970), 51% CPU",
"Elapsed application CPU time (seconds): 4.109, 15% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff833de108a kevent_qos + 10
1   libdispatch.dylib             	       0x107f6a0cd _dispatch_kq_poll + 113
2   libdispatch.dylib             	       0x107f69d8f _dispatch_kq_drain + 267
3   libdispatch.dylib             	       0x107f696f8 _dispatch_event_loop_poke + 185
4   libdispatch.dylib             	       0x107f5f1c8 dispatch_after + 547
5   AXCoreUtilities               	       0x111cf0c68 AXPerformBlockOnMainThreadAfterDelay + 104
6   AccessibilityUtilities        	       0x1528f6f67 _axmonitor_dyld_image_callback + 199
7   dyld_sim                      	       0x103111ac5 invocation function for block in dyld4::APIs::_dyld_register_func_for_add_image(void (*)(mach_header const*, long)) + 175
8   dyld_sim                      	       0x1030f1e75 dyld4::RuntimeState::withLoadersReadLock(void () block_pointer) + 47
9   dyld_sim                      	       0x103111920 dyld4::APIs::_dyld_register_func_for_add_image(void (*)(mach_header const*, long)) + 112
10  AccessibilityUtilities        	       0x1528f6e8c __23-[AXBinaryMonitor init]_block_invoke + 28
11  libdispatch.dylib             	       0x107f447fb _dispatch_call_block_and_release + 12
12  libdispatch.dylib             	       0x107f45a3a _dispatch_client_callout + 8
13  libdispatch.dylib             	       0x107f5532c _dispatch_main_queue_drain + 1338
14  libdispatch.dylib             	       0x107f54de4 _dispatch_main_queue_callback_4CF + 31
15  CoreFoundation                	       0x1066529f7 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
16  CoreFoundation                	       0x10664d3c6 __CFRunLoopRun + 2482
17  CoreFoundation                	       0x10664c637 CFRunLoopRunSpecific + 560
18  GraphicsServices              	       0x10f65828a GSEventRunModal + 139
19  UIKitCore                     	       0x11b04e425 -[UIApplication _run] + 994
20  UIKitCore                     	       0x11b053301 UIApplicationMain + 123
21  Preferences                   	       0x102ea4c38 0x102e9a000 + 44088
22  dyld_sim                      	       0x1030ee2bf start_sim + 10
23  dyld                          	       0x10774a52e start + 462

@danilobuerger that's interesting, for some reason I'm unable to reproduce this crash. Is it still happening?

asafkorem avatar Oct 18 '22 11:10 asafkorem