DetoxRecorder: `which` NSTask may fail to parse result when shell initialization prints unrelated output

Here is my configuration for .detoxrc.json:

{
  "testRunner": "jest",
  "runnerConfig": "e2e/config.json",
  "configurations": {
    "ios": {
      "type": "ios.simulator",
      "binaryPath": "./ios/build/Build/Products/Debug-iphonesimulator/MyProject.app",
      "build": "xcodebuild -workspace ios/MyProject.xcworkspace -scheme MyProject-Dev -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
      "device": {
        "type": "iPhone 11"
      }
    }
  }
}

Here is the command I’m running:

detox recorder --configuration "ios" --outputTestFile "~/Desktop/TestRecord.js" --testName "Test Record" --record

I received the following stack logs:

2020-07-10 11:18:35.989 DetoxRecorderCLI[74877:5851920] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'must provide a launch path'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff39430d07 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff721545bf objc_exception_throw + 48
	2   Foundation                          0x00007fff3baeb342 COPY_SETTER_IMPL + 360
	3   DetoxRecorderCLI                    0x000000010cd292c3 $s16DetoxRecorderCLI20applesimutilsProcessSo6NSTaskCyF + 163
	4   DetoxRecorderCLI                    0x000000010cd2aad6 $s16DetoxRecorderCLI18prepareSimulatorId09simulatorF06configS2SSg_AEtF + 1670
	5   DetoxRecorderCLI                    0x000000010cd25e39 main + 4121
	6   libdyld.dylib                       0x00007fff732fbcc9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Please note that

  • The app does not launch with detox recorder
  • detox build --configuration ios has successfully built my application
  • detox test --configuration ios has successfully run my tests

Edit:

  • Running detox recorder --outputTestFile "~/Desktop/TestRecord.js" --testName "Test Record" --simulatorId "SIMULATOR_ID" --record --bundleId "my.bundle.id" with the app preinstalled triggers the same error

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (15 by maintainers)

Most upvoted comments

I wonder why it works on my Mac. I’ll fix it a bit later. I’ll be releasing a new version tomorrow, with this fix, as well as the file shenanigans.

🤦‍♂️

Will do