DetoxRecorder: Crash on start recording

Describe the Bug The app crashes on start recording

To Reproduce run command: detox recorder --configuration iosDebug --simulatorId booted --outputTestFile "~/Desktop/RecordedTest.js" --testName "My Recorded Test" --record

.detoxrc.json config:

...
"iosDebug": {
      "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/myapp.app",
        "build": "xcodebuild -workspace ios/myapp.xcworkspace -scheme myapp -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES",
        "type": "ios.simulator",
        "name": "iPhone 11",
        "device": {
          "type": "iPhone 11"
        }
    }
    ...

Expected Behavior Expect to launch and start recording

Actual Behavior The app crashes on boot

Screenshots If applicable, add screenshots to help explain your problem.

Environment

  • macOS: [e.g. 11.3.1]
  • Xcode: [e.g. 12.5]
  • iOS Simulator Runtime: [e.g. iOS 14.5]
  • Detox Recorder Version: [e.g. 1.0.151]

Logs Post here the output of

log stream --level debug --style compact --predicate "subsystem=='DetoxRecorder'"
Timestamp        Ty Process[PID:TID]
2021-06-04 11:56:06.022 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Parsing arguments
2021-06-04 11:56:06.024 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /bin/bash with arguments: [“-l”, “-c”, “which applesimutils”] environment: [:]
2021-06-04 11:56:06.260 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /usr/local/bin/applesimutils with arguments: [“--list”, “--booted”] environment: [:]
2021-06-04 11:56:06.418 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Attempting to discover Detox config file
2021-06-04 11:56:06.420 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Using “.detoxrc.json” config file
2021-06-04 11:56:06.420 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /bin/bash with arguments: [“-l”, “-c”, “which xcrun”] environment: [:]
2021-06-04 11:56:06.655 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /usr/bin/xcrun with arguments: [“simctl”, “install”, “C15FAC68-9112-43EE-B348-2620BD751F05", “ios/build/Build/Products/Debug-iphonesimulator/myapp.app”] environment: [:]
2021-06-04 11:56:08.794 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /usr/bin/xcrun with arguments: [“simctl”, “get_app_container”, “C15FAC68-9112-43EE-B348-2620BD751F05", “com.myapp”] environment: [:]
2021-06-04 11:56:10.934 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /usr/bin/nm with arguments: [“-U”, “/Users/user/Library/Developer/CoreSimulator/Devices/C15FAC68-9112-43EE-B348-2620BD751F05/data/Containers/Bundle/Application/964B24D1-CF54-428E-B967-A9EB7A77506B/myapp.app/myapp”] environment: [:]
2021-06-04 11:56:11.493 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /usr/bin/otool with arguments: [“-L”, “/Users/user/Library/Developer/CoreSimulator/Devices/C15FAC68-9112-43EE-B348-2620BD751F05/data/Containers/Bundle/Application/964B24D1-CF54-428E-B967-A9EB7A77506B/myapp.app/myapp”] environment: [:]
2021-06-04 11:56:11.665 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] App binary requires framework injection: true
2021-06-04 11:56:11.665 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /usr/bin/xcrun with arguments: [“simctl”, “terminate”, “C15FAC68-9112-43EE-B348-2620BD751F05", “com.myapp”] environment: [:]
2021-06-04 11:56:12.611 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Published recording service: <NSNetService 0x7fc743511220> local. _detoxrecorder._tcp. AF8861DE-777E-4707-A885-76029DA4BB6A 49299
2021-06-04 11:56:12.612 I DetoxRecorderCLI[77479:914c6] [DetoxRecorder:CLI] Launching /usr/bin/xcrun with arguments: [“simctl”, “launch”, “C15FAC68-9112-43EE-B348-2620BD751F05", “com.myapp”, “-DTXRecStartRecording”, “1”, “-DTXRecTestName”, “My Recorded Test”, “-DTXServiceName”, “AF8861DE-777E-4707-A885-76029DA4BB6A”] environment: [“SIMCTL_CHILD_DYLD_INSERT_LIBRARIES”: “/Users/user/Desktop/hotfin/mobile-app/node_modules/detox-recorder/DetoxRecorder.framework/DetoxRecorder”]

in addition to any other output you get from the command line.

Additional Context Crash log from Flipper:

Process:               myapp [77831]
Path:                  /Users/USER/Library/Developer/CoreSimulator/Devices/C15FAC68-9112-43EE-B348-2620BD751F05/data/Containers/Bundle/Application/964B24D1-CF54-428E-B967-A9EB7A77506B/myapp.app/myapp
Identifier:            myapp
Version:               1.402 (8)
Code Type:             X86-64 (Native)
Parent Process:        launchd_sim [40687]
Responsible:           SimulatorTrampoline [33093]
User ID:               501
Date/Time:             2021-06-04 11:56:12.851 +0300
OS Version:            macOS 11.3.1 (20E241)
Report Version:        12
Bridge OS Version:     5.4 (18P4663)
Anonymous UUID:        4B818C85-D8F7-B25B-A082-F50DB7156E2A
Sleep/Wake UUID:       71BFA821-933A-43E5-B7C1-D574A8AFB2C1
Time Awake Since Boot: 26000 seconds
Time Since Wake:       9500 seconds
System Integrity Protection: enabled
Crashed Thread:        0
Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY
Termination Reason:    DYLD, [0x9] <unknown>
Application Specific Information:
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/user/Library/Developer/CoreSimulator/Caches/dyld/20E241/com.apple.CoreSimulator.SimRuntime.iOS-14-5.18E182
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_INSERT_LIBRARIES=/Users/user/Desktop/hotfin/mobile-app/node_modules/detox-recorder/DetoxRecorder.framework/DetoxRecorder
DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks
DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
Dyld Error Message:
  could not load inserted library ‘/Users/user/Desktop/hotfin/mobile-app/node_modules/detox-recorder/DetoxRecorder.framework/DetoxRecorder’ because no suitable image found.  Did find:
	/Users/user/Desktop/hotfin/mobile-app/node_modules/detox-recorder/DetoxRecorder.framework/DetoxRecorder: open() failed with errno=1
Binary Images:
       0x108955000 -        0x10a0e8fff +com.myapp (1.402 - 8) <18FB1DB6-7905-3A47-8AE0-45AB3048F9D5> /Users/USER/Library/Developer/CoreSimulator/Devices/C15FAC68-9112-43EE-B348-2620BD751F05/data/Containers/Bundle/Application/964B24D1-CF54-428E-B967-A9EB7A77506B/myapp.app/myapp
       0x10d155000 -        0x10d1aefff +dyld_sim (851.28) <2A92FC99-72A9-38ED-8DDD-AF4C25080124> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
       0x1181da000 -        0x118275fff  dyld (851.27) <7EAA668B-F906-3BAA-A980-139BBE6E8766> /usr/lib/dyld

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 9
  • Comments: 21

Commits related to this issue

Most upvoted comments

Sorry guys, we are not maintaining this project at the moment… We may revisit this decision soon, but for now our focus is on other Detox improvements.

Interesting @asafkorem , considering the main project boasts about the recorder as a major feature and links to it from the documentation.

I have same problem, I ran recorder, app launches & crashes. But I get no error, and recorder says “Recording… (CTRL+C to stop)”

@MuckT , hmm @asafkorem could you write back here?

Please consider removing/altering the recommendation here to use detox recorder… https://wix.github.io/Detox/docs/introduction/writing-first-test#detox-recorder

This was an unfortunate setback in my first time using Detox.

Hopefully I’ll enjoy the rest of the product 👍🏼

(PS – I tried the Edit this page link but got a 404)

Still not useable with latest Detox

Maybe the issue is, that on MacOs 12.1 the AccessibilityUtilities.framework are not located, where the script assumes it should? https://github.com/wix/DetoxRecorder/blob/99820782a02fb771a7c1da4b2d9834abafc89172/DetoxRecorder/Utils/UIApplication%2BEnableAccessibility.m#L27

Or at least, is not present on my machine - Anybody who knows the new location og those utilities? I am no swift expert at all, I could just assume, that if that path does not exist, the process could fail?

Same issue. Any updates?