Detox: [RN 72] iOS Simulator cannot terminate app
What happened?
Added Detox to an existing react native project. It failed to complete the detox test command due
child-process:EXEC_FAIL “/usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject” failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
After reading about others who had similar issues, I assumed it was my project configuration. So I then used the sample in React Native and confirmed the AwesomeProject successfully deployed on the simulator. Then followed the instructions from the Detox site and successfully ran detox build; However, it fails in the same way as my original project.
MacBook Pro - M1 2020 macOS Ventura 13.4.1 Xcode 14.3.1
detox test -l verbose --cleanup --configuration ios.sim.debug
What was the expected behaviour?
The iOS simulator would terminate the app
Was it tested on latest Detox?
- I have tested this issue on the latest Detox release and it still reproduces.
Did your test throw out a timeout?
- I have followed the instructions under Identifying which synchronization mechanism causes us to wait too much.
Help us reproduce this issue!
No response
In what environment did this happen?
Detox version: 20.11.1 React Native version: 0.72.3 Has Fabric (React Native’s new rendering system) enabled: (yes/no) No Node version: v20.5.0 Device model: iPhone 14 iOS version: macOS version: Ventura 13.4.1. (M1 2020) Xcode version: 14.3.1 Test-runner (select one): jest / other. Jest
Detox logs
Detox logs
(base) thechrisoneil@Chriss-MacBook-Pro AwesomeProject % detox test -l verbose --cleanup --configuration ios.sim.debug
15:27:01.491 detox[13335] i ws-server Detox server listening on localhost:50627...
15:27:01.495 detox[13335] B lifecycle jest --config e2e/jest.config.js
watchman warning: Recrawled this watch 3 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/thechrisoneil/software/react-native/AwesomeProject' ; watchman watch-project '/Users/thechrisoneil/software/react-native/AwesomeProject'`
Determining test suites to run...
15:27:02.348 detox[13336] i child-process:EXEC_CMD applesimutils --list --byType "iPhone 14"
15:27:02.585 detox[13336] i child-process:EXEC_CMD applesimutils --list --byId B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 --maxResults 1
15:27:02.806 detox[13336] i child-process:EXEC_CMD /usr/bin/xcrun simctl boot B9AD5297-A76B-41D8-9C0F-435F87BBE3B3
15:27:02.806 detox[13336] i child-process:EXEC_TRY Booting device B9AD5297-A76B-41D8-9C0F-435F87BBE3B3...
15:27:03.259 detox[13336] i child-process:EXEC_CMD /usr/bin/xcrun simctl bootstatus B9AD5297-A76B-41D8-9C0F-435F87BBE3B3
15:27:06.770 detox[13336] i child-process:EXEC_CMD open -a Simulator --args -CurrentDeviceUDID B9AD5297-A76B-41D8-9C0F-435F87BBE3B3
15:27:06.838 detox[13336] i child-process:EXEC_CMD /usr/bin/xcrun simctl io B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 screenshot "/dev/null"
15:27:07.412 detox[13336] i child-process:EXEC_CMD /usr/bin/xcrun simctl uninstall B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject
15:27:07.412 detox[13336] i child-process:EXEC_TRY Uninstalling org.reactjs.native.example.AwesomeProject...
15:27:08.154 detox[13336] i child-process:EXEC_SUCCESS org.reactjs.native.example.AwesomeProject uninstalled
15:27:08.156 detox[13336] i child-process:EXEC_CMD /usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject
15:27:08.156 detox[13336] i child-process:EXEC_TRY Terminating org.reactjs.native.example.AwesomeProject...
15:27:09.600 detox[13336] i child-process:EXEC_TRY Terminating org.reactjs.native.example.AwesomeProject...
15:27:09.878 detox[13336] i child-process:EXEC_FAIL "/usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject" failed with error = ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device returned an error for the requested operation.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
The request to terminate "org.reactjs.native.example.AwesomeProject" failed. found nothing to terminate
found nothing to terminate
`/usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject` (exited with error code 3) (code=3), stdout and stderr:
15:27:09.878 detox[13336] i child-process:EXEC_FAIL
15:27:09.878 detox[13336] i child-process:EXEC_FAIL An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device returned an error for the requested operation.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
The request to terminate "org.reactjs.native.example.AwesomeProject" failed. found nothing to terminate
found nothing to terminate
15:27:09.883 detox[13335] E ws-server connection :50627<->:50628
15:27:09.883 detox[13336] i child-process:EXEC_CMD /usr/bin/xcrun simctl shutdown B9AD5297-A76B-41D8-9C0F-435F87BBE3B3
15:27:09.883 detox[13336] i child-process:EXEC_TRY Shutting down B9AD5297-A76B-41D8-9C0F-435F87BBE3B3...
15:27:13.266 detox[13336] i child-process:EXEC_SUCCESS B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 shut down
FAIL e2e/starter.test.js
● Test suite failed to run
ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device returned an error for the requested operation.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
The request to terminate "org.reactjs.native.example.AwesomeProject" failed. found nothing to terminate
found nothing to terminate
`/usr/bin/xcrun simctl terminate B9AD5297-A76B-41D8-9C0F-435F87BBE3B3 org.reactjs.native.example.AwesomeProject` (exited with error code 3)
at callback (node_modules/child-process-promise/lib/index.js:33:27)
15:27:13.385 detox[13335] E lifecycle Command failed with exit code = 1:
jest --config e2e/jest.config.js
15:27:13.386 detox[13335] i ws-server Detox server has been closed gracefully
Device logs
Device logs
paste your device.log here!
More data, please!
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 27 (5 by maintainers)
I am also experiencing this issue after upgrading react native to 0.72.3
It sounds like there’s an issue with RN 72 and Detox. We don’t officially support this version yet, but we will soon. We will take this issue into consideration when upgrading Detox to comply with RN 72.
i’m running into the issue still with detox 20.19.1 when using xcode 15.2.0 RN 0.70.13 in circleci.
Hi all. With same codebase I’m able to reproduce this bug on machine with XCode 15. But it works well with previous XCode version. I’ve applied patch to
detox@19.13.0
. As a temporary solution to disable termination.after updating XCode to latest 15.0.1/15A507. it works well without patch. I think it was xcode issue. Tried on mac-m1 with “react-native”: “0.72.6”, “detox”: “^20.13.5”,
react-native “0.71.14”, encountered the same issue. Then upgraded detox from “^20.5.0” to “^20.13.5”, the issue resolved. By the way, my xcode version is “15.0.1/15A507”
Hate to be a “me too” without anything substantive to add, but adding anyway just to reflect another user with the same problem. I can reproduce this reliably on my M1 Mac, v19.12.6 on 0.72.6. It fails within seconds of invocation.
If/when I find anything interesting I’ll be sure to update.
Guys, we will only advance here if you create some exact reproduction repo. I understand you have an issue, but the conditions to reproduce this issue seem much more specific than originally described. There has to be something else in the equation.
You seem to report different RN and Xcode versions, whereas I try both Xcode 14.3 and 15 and I don’t see any issues with app termination. There has to be something more to it.
I created a fresh RN app
npx react-native@latest init AwesomeProject
and ran Detox tests on it – termination happens just like expected.Some of my colleagues are seeing this on “react-native”: “0.72.4”, “detox”: “20.9.1”,
hi @kvramyasri7, we use
BTW in our version we added NO_FLIPPER config in
react-native.config.js
and installed pods without flipper. Otherwisedetox build
is failing. Also IOS 17 version on simulator is 3 times slower in our CI machine. So we switched to IOS 16.4. p.s. this version of react-native has support of XCode 15.I’m seeing the same issue with RN 0.71.11 and Detox 19.5.7