Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key “device” either not found or in unsupported format as found in package.json for the “debug:ios” configuration. #13

Open
hkar19 opened this issue Mar 17, 2021 · 14 comments
Labels
bug Something isn't working

Comments

@hkar19
Copy link

hkar19 commented Mar 17, 2021

Describe the Bug
I cannot run
detox recorder --configuration debug:ios --outputTestFile "~/Desktop/RecordedTest.js" --testName "My Recorded Test" --record

as it shows error:
Key “device” either not found or in unsupported format as found in package.json for the “debug:ios” configuration.

my .detoxrc.json

{
  "testRunner": "jest",
  "runnerConfig": "e2e/config.json",
  "apps": {
    "debug:ios": {
      "build": "react-native run-ios --simulator='iPhone 8'",
      "type": "ios.app",
      "binaryPath": "path/to/app"
    },
    "android": {
      "type": "android.apk",
      "binaryPath": "SPECIFY_PATH_TO_YOUR_APP_BINARY"
    }
  },
  "devices": {
    "simulator": {
      "type": "ios.simulator",
      "device": {
        "type": "iPhone 8"
      }
    },
    "emulator": {
      "type": "android.emulator",
      "device": {
        "avdName": "Pixel_3a_API_30_x86"
      }
    }
  },
  "configurations": {
    "debug:ios": {
      "device": "simulator",
      "app": "debug:ios"
    },
    "android": {
      "device": "emulator",
      "app": "android"
    }
  }
}

where did i do wrong?

To Reproduce
i run
detox recorder --configuration debug:ios --outputTestFile "~/Desktop/RecordedTest.js" --testName "My Recorded Test" --record

Expected Behavior
it run

Actual Behavior
it shows error

@hkar19 hkar19 added the bug Something isn't working label Mar 17, 2021
@rakuju87
Copy link

I am facing the same issue. Right now I am using the below way until I get a sample config.
detox recorder --bundleId "com.example.myApp" --simulatorId booted --outputTestFile "~/Desktop/RecordedTest.js" --testName "My Recorded Test" --record

@avac-porch
Copy link

Also have this issue using .detoxrc.json and not package.json

I've also verified the json is valid as mentioned in docs.

@noumantahir
Copy link

facing the same issues, any recommended fixes....?

@joseguya
Copy link

joseguya commented Sep 7, 2021

Same here, cant run the recorder while using detoxrc.json

@hipages-ligang
Copy link

Same here. I think it a bug for DetoxRecorder. According to the document of Detox, we add the configuration in ".detoxrc.json", Please have a look @LeoNatan

@LeoNatan
Copy link
Contributor

I am no longer involved with this project or Wix. Thanks

@youngjunaquinas
Copy link

is this project no longer maintained/updated?

@aviatam
Copy link

aviatam commented Mar 13, 2022

any update ?

@JordanBrion
Copy link

I am also facing the same issue. Any update?

@hkar19
Copy link
Author

hkar19 commented Apr 4, 2022

Apparently this repo has been forsaken. last commit by any contributor to master was on 10 Feb 2021.
Maybe we should play with another things?

@JordanBrion
Copy link

I managed to make the recorder work on the iOS simulator.

package.json:
"detox": "^19.5.7", "detox-recorder": "^1.0.151",

.detoxrc.json:
{ "testRunner": "jest", "runnerConfig": "e2e/config.json", "skipLegacyWorkersInjection": true, "apps": { "ios.release": { "name": "yourproject", "type": "ios.app", "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/yourproject.app", "build": "xcodebuild -workspace ios/yourproject.xcworkspace -scheme yourproject -configuration Release -sdk iphonesimulator -derivedDataPath ios/build" }, "ios.debug": { "name": "yourproject", "type": "ios.app", "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/yourproject.app", "build": "xcodebuild -workspace ios/yourproject.xcworkspace -scheme yourproject -sdk iphonesimulator -derivedDataPath ios/build" }, "android.debug": { "type": "android.apk", "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk", "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd .." }, "android.release": { "type": "android.apk", "binaryPath": "android/app/build/outputs/apk/release/app-release.apk", "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd .." } }, "devices": { "simulator": { "type": "ios.simulator", "device": { "type": "iPhone 11" } }, "emulator": { "type": "android.emulator", "device": { "avdName": "Pixel_2_API_30" } } }, "configurations": { "ios.sim.release": { "device": "simulator", "app": "ios.release" }, "ios.sim.debug": { "device": "simulator", "app": "ios.debug" }, "android.emu.debug": { "device": "emulator", "app": "android.debug" }, "android.emu.release": { "device": "emulator", "app": "android.release" } } }

Build and run your project in Xcode with simulator iOS 13.7. (I experienced crashes with iOS 15 and 12)

Then type in your React Native project:
detox recorder -b org.reactjs.native.example.yourproject -s booted -o "./yourtestcase.js" --record

@ansonliao
Copy link

Same issue + 1

@RWOverdijk
Copy link

This does seem to not work, regardless of .detoxrc.json or package.json. Trying to run on an already active simulator does seem to start the app but then immediately crashes. The js file gets created but obviously contains no tests.

Do we have any pointers as to what might be causing this?

@mariushorvat
Copy link

mariushorvat commented Mar 8, 2023

I managed to make the recorder work on the iOS simulator.

package.json: "detox": "^19.5.7", "detox-recorder": "^1.0.151",

.detoxrc.json: { "testRunner": "jest", "runnerConfig": "e2e/config.json", "skipLegacyWorkersInjection": true, "apps": { "ios.release": { "name": "yourproject", "type": "ios.app", "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/yourproject.app", "build": "xcodebuild -workspace ios/yourproject.xcworkspace -scheme yourproject -configuration Release -sdk iphonesimulator -derivedDataPath ios/build" }, "ios.debug": { "name": "yourproject", "type": "ios.app", "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/yourproject.app", "build": "xcodebuild -workspace ios/yourproject.xcworkspace -scheme yourproject -sdk iphonesimulator -derivedDataPath ios/build" }, "android.debug": { "type": "android.apk", "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk", "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd .." }, "android.release": { "type": "android.apk", "binaryPath": "android/app/build/outputs/apk/release/app-release.apk", "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd .." } }, "devices": { "simulator": { "type": "ios.simulator", "device": { "type": "iPhone 11" } }, "emulator": { "type": "android.emulator", "device": { "avdName": "Pixel_2_API_30" } } }, "configurations": { "ios.sim.release": { "device": "simulator", "app": "ios.release" }, "ios.sim.debug": { "device": "simulator", "app": "ios.debug" }, "android.emu.debug": { "device": "emulator", "app": "android.debug" }, "android.emu.release": { "device": "emulator", "app": "android.release" } } }

Build and run your project in Xcode with simulator iOS 13.7. (I experienced crashes with iOS 15 and 12)

Then type in your React Native project: detox recorder -b org.reactjs.native.example.yourproject -s booted -o "./yourtestcase.js" --record

I was able to use Detrox Recorder. I've used simulator iOS 14.5 (iPhone 12) (I've experienced crashes with iOS 15 and 16)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests