Detox e2e/hooks can't start simulator

62 Views Asked by At

all. For some reasons iOS and Android simulators in Detox/expo stack began to fall and can not start all over again. Any thoughts? Thank you

VError: a BeforeAll hook errored, process exiting: e2e/hooks.js:4: Command failed: /usr/bin/xcrun simctl terminate 009B7E66-E692-411D-94CC-C0CF9E294FCC my_app
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 "my_app" failed. found nothing to terminate
        found nothing to terminate
 `/usr/bin/xcrun simctl terminate 009B7E66-E692-411D-94CC-C0CF9E294FCC my_app` (exited with error code 3)
    at Runtime.runTestRunHooks (/Users/me/cucumber-app/node_modules/@cucumber/cucumber/src/runtime/run_test_run_hooks.ts:32:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Runtime.start (/Users/me/cucumber-app/node_modules/@cucumber/cucumber/src/runtime/index.ts:103:5)
    at runCucumber (/Users/me/cucumber-app/node_modules/@cucumber/cucumber/src/api/run_cucumber.ts:125:19)
    at Cli.run (/Users/me/cucumber-app/node_modules/@cucumber/cucumber/src/cli/index.ts:79:25)
    at Object.run [as default] (/Users/me/cucumber-app/node_modules/@cucumber/cucumber/src/cli/run.ts:33:14)
caused by: ChildProcessError: Command failed: /usr/bin/xcrun simctl terminate 009B7E66-E692-411D-94CC-C0CF9E294FCC my_app
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 "my_app" failed. found nothing to terminate
        found nothing to terminate
 `/usr/bin/xcrun simctl terminate 009B7E66-E692-411D-94CC-C0CF9E294FCC my_app` (exited with error code 3)
    at callback (/Users/me/cucumber-app/node_modules/child-process-promise/lib/index.js:33:27)
    at ChildProcess.exithandler (node:child_process:427:5)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)

and e2e/hooks file looks like this:

import { Before, After, BeforeAll, AfterAll } from '@cucumber/cucumber';
import detox from 'detox/internals';

BeforeAll({ timeout: 120 * 5000 }, async () => {
  await detox.init();
  const platform = device.getPlatform();

  if (platform === 'ios') {
    await device.launchApp({
      newInstance: true,
    });

    await sleep(1000);
  } else {
    try {
      await device.launchApp({
        newInstance: false,
      });
    } catch (e) {
      console.log(e);
    }
    await sleep(10000);
  }
});

I run this all with: macOs: Sonoma 14.1.1 apple chip M1 and: "@babel/core": "^7.20.0", "@babel/register": "^7.22.15", "@config-plugins/detox": "^3.0.0", "@cucumber/cucumber": "^9.5.1", "detox": "^20.11.3", "jest": "^29.5.0"

To make simulators run again

0

There are 0 best solutions below