0

package.json

  "detox": {
    "test-runner": "jest",
        "configurations": {
            "ios.sim": {
            "build": "xcodebuild -workspace ios/lamunchies.xcworkspace -scheme lamunchies -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
            "binaryPath": "ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app",
           "type": "ios.simulator",
          "name": "iPhone 8"
          }
        }
  }

firstTestSpecs.js

describe('Example', () => {
  beforeEach(async () => {
    await device.reloadReactNative()
  })

  it('should have welcome screen', async () => {
    await expect(element(by.id('Settings'))).toBeVisible()
  })
})

logs

detox[38188] ERROR: [exec.js/EXEC_FAIL, #3] An error was encountered processing the command (domain=NSPOSIXErrorDo
main, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.

detox[38188] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR] 
 { ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/j
ordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
 `/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
    at callback (/Users/jordeguevara/Desktop/LAMunchies/node_modules/child-process-promise/lib/index.js:33:27)
    at ChildProcess.exithandler (child_process.js:301:5)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
  name: 'ChildProcessError',
  code: 22,
  childProcess:
   { ChildProcess: { [Function: ChildProcess] super_: [Function] },
     fork: [Function: fork],
     _forkChild: [Function: _forkChild],
     exec: [Function: exec],
     execFile: [Function: execFile],
     spawn: [Function: spawn],
     spawnSync: [Function: spawnSync],
     execFileSync: [Function: execFileSync],
     execSync: [Function: execSync] },
  stdout: '',
  stderr:
   'An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe application\'s Info.plist does not contain CFBundleShortVersionString.\nEnsure your bundle contains a CFBundleShortVersionString.\n' }
Example: should have welcome screen
Example: should have welcome screen [FAIL]

 FAIL  e2e/firstTest.spec.js (6.516s)
  Example
    ✕ should have welcome screen (4ms)

  ● Example › should have welcome screen

    ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/......../ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
    An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
    Failed to install the requested application
    The application's Info.plist does not contain CFBundleShortVersionString.
    Ensure your bundle contains a CFBundleShortVersionString.
     `/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/...../ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)

      at callback (../node_modules/child-process-promise/lib/index.js:33:27)

  ● Example › should have welcome screen

    ReferenceError: device is not defined

      1 | describe('Example', () => {
      2 |   beforeEach(async () => {
    > 3 |     await device.reloadReactNative()
        |           ^
      4 |   })
      5 | 
      6 |   it('should have welcome screen', async () => {

      at _callee$ (firstTest.spec.js:3:11)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:271:22)
      at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:135:20)
      at ../node_modules/regenerator-runtime/runtime.js:170:11
      at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:169:16)
      at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:192:13)
      at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
      at Object.<anonymous>.exports.async (../node_modules/regenerator-runtime/runtime.js:216:14)
      at Object._callee (firstTest.spec.js:2:14)

  ● Example › should have welcome screen

    ReferenceError: element is not defined

      4 |   })
      5 | 
    > 6 |   it('should have welcome screen', async () => {
        |                                    ^
      7 |     await expect(element(by.id('Settings'))).toBeVisible()
      8 |   })
      9 | })

      at _callee2$ (firstTest.spec.js:6:36)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:271:22)
      at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:135:20)
      at ../node_modules/regenerator-runtime/runtime.js:170:11
      at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:169:16)
      at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:192:13)
      at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
      at Object.<anonymous>.exports.async (../node_modules/regenerator-runtime/runtime.js:216:14)
      at Object._callee2 (firstTest.spec.js:6:36)

detox[38187] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config e2e/config.json '--testNamePat
tern=^((?!:android:).)*$' --maxWorkers 1 "e2e"

The application's Info.plist does not contain CFBundleShortVersionString.
    Ensure your bundle contains a CFBundleShortVersionString.
     `/usr/bin/xcrun simctl install 62BBE686-316C-4D6E-9625-E8D21F60CE97 "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)

      at callback (../node_modules/child-process-promise/lib/index.js:33:27)

detox[37766] ERROR: [cli.js] Error: Command failed: node_modules/.bin/jest --config e2e/config.json '--testNamePat
tern=^((?!:android:).)*$' --maxWorkers 1 "e2e"

MacBook-Pro-9:LAMunchies jordeguevara$ detox test
detox[37982] INFO:  [test.js] configuration="ios.sim" reportSpecs=true DETOX_START_TIMESTAMP=1579315003125 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:android:).)*$' --maxWorkers 1 "e2e"
detox[37983] INFO:  [DetoxServer.js] server listening on localhost:55101...
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6] "/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/
Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"" f
ailed with code = 22, stdout and stderr:

detox[37983] ERROR: [exec.js/EXEC_FAIL, #6] 
detox[37983] ERROR: [exec.js/EXEC_FAIL, #6] An error was encountered processing the command (domain=NSPOSIXErrorDo
main, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.

detox[37983] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR] 
 { ChildProcessError: Command failed: /usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/j
ordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.
Ensure your bundle contains a CFBundleShortVersionString.
 `/usr/bin/xcrun simctl install 7FB82147-C9FD-4746-B144-324E07C64D2F "/Users/jordeguevara/Desktop/LAMunchies/ios/build/lamunchies/Build/Products/Debug-iphonesimulator/lamunchies.app"` (exited with error code 22)
    at callback (/Users/jordeguevara/Desktop/LAMunchies/node_modules/child-process-promise/lib/index.js:33:27)
    at ChildProcess.exithandler (child_process.js:301:5)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
  name: 'ChildProcessError',
  code: 22,
  childProcess:
   { ChildProcess: { [Function: ChildProcess] super_: [Function] },
     fork: [Function: fork],
     _forkChild: [Function: _forkChild],
     exec: [Function: exec],
     execFile: [Function: execFile],
     spawn: [Function: spawn],
     spawnSync: [Function: spawnSync],
     execFileSync: [Function: execFileSync],
     execSync: [Function: execSync] },
  stdout: '',
  stderr:
   'An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe application\'s Info.plist does not contain CFBundleShortVersionString.\nEnsure your bundle contains a CFBundleShortVersionString.\n' }

I was trying to set up Detox on my reat native project via CLI but ran into some trouble.

I tried adding CFBundleShortVersionString to InfoList but it was already there.

I followed the steps to set up detox in this article : https://blog.expo.io/testing-expo-apps-with-detox-and-react-native-testing-library-7fbdbb82ac87

Any help would be appreciated

Jorde G
  • 51
  • 3
  • That error most likely means that the .app is not in the place where Detox expects it to be. Verify that your build is running correctly, and the output path is correct. – Léo Natan Jan 25 '20 at 22:19

1 Answers1

0

So hopefully this helps someone

Failed to install the requested application
The application's Info.plist does not contain CFBundleShortVersionString.

it told me it my CFBundleShortVersionString already it existed but I just changed it to a different number in my Info.plist and it worked from there

Jorde G
  • 51
  • 3