Reputation: 49
Describe the bug
After upgrading my MacOS from High Sierra to Mojave and Xcode from 10.x to 11.3, I'm no longer able to run the Detox test.. It gives me this error below about not having iOS simulators.
**DetoxRuntimeError: Failed to find a device by UDID = "7C50BE35-0CDE-413A-A08D-784E98C61010" and by type = "iPhone 11 Pro"
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version.
at SimulatorDriver._queryDevices (../node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13)**
So I ran applesimutils --list command and received empty list like below. [
]
But if I run xcrun simctl list devices then I get the list of devices pertaining to iOS 13.3
To Reproduce
Provide the steps necessary to reproduce the issue. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version.
at SimulatorDriver._queryDevices (../node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13)
Ran applesimutils --list command. Received an empty list [ ]
But if I run xcrun simctl list devices then I get the list of devices pertaining to iOS 13.3. I even changed my package.json to reflect the latest migration guide link below and included the device object - https://github.com/wix/Detox/blob/master/docs/Guide.Migration.md
This is how my package.json looks like
"detox": {
"configurations": {
"ios.sim.debug": {
"type": "ios.simulator",
"binaryPath": "build/native/QuickSightiOS-2.0.2096.d.d.app",
"build": "xcodebuild -project ios/quicksight-react-native-mobile-tests.xcodeproj -scheme quicksight-react-native-mobile-tests -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"device": {
"type": "iPhone 11 Pro",
"id": "7C50BE35-0CDE-413A-A08D-784E98C61010"
}
}
},
"test-runner": "jest"
},`
brew tap wix/brew brew install applesimutils
After running the 2nd command above, i got this error
**4c32759b84a9:QuicksightReactNativeMobileTests kondurc$ brew install applesimutils Updating Homebrew... Error: applesimutils: /usr/local/Homebrew/Library/Taps/wix/homebrew-brew/applesimutils.rb:4: syntax error, unexpected <<, expecting end <<<<<<< HEAD ^~
^~~ /usr/local/Homebrew/Library/Taps/wix/homebrew-brew/applesimutils.rb:24: syntax error, unexpected >>, expecting end
Detox Instruments 1.9.9... ^~ /usr/local/Homebrew/Library/Taps/wix/homebrew-brew/applesimutils.rb:24: unexpected fraction part after numeric literal Detox Instruments 1.9.9876**
Expected behavior I would expect applesimutils --list command to show the list of simulators supported and eventually my detox test to run successfully instead of complaining about failing to find the device type.
Environment (please complete the following information): - Detox: 14.9.2 - React Native: 0.60.4 - Node: v10.15.1 - Device: iPhone 11 Pro (simulator) - Xcode: 11.3 - iOS: 13.3 - macOS: Mojave
Device and Verbose Detox Logs 4c32759b84a9:QuicksightReactNativeMobileTests kondurc$ detox test --loglevel trace detox[63893] INFO: [test.js] configuration="ios.sim.debug" loglevel="trace" reportSpecs=true DETOX_START_TIMESTAMP=1578349653101 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:android:).)*$' --maxWorkers 1 "e2e" detox[63894] INFO: [DetoxServer.js] server listening on localhost:50258... detox[63894] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:50258 detox[63894] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"6d94b773-5329-fab7-89ae-add64e14cdec","role":"tester"},"messageId":0} detox[63894] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=6d94b773-5329-fab7-89ae-add64e14cdec detox[63894] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=6d94b773-5329-fab7-89ae-add64e14cdec detox[63894] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"6d94b773-5329-fab7-89ae-add64e14cdec","role":"tester"},"messageId":0}
detox[63894] DEBUG: [exec.js/EXEC_CMD, #0] applesimutils --list --byId 7C50BE35-0CDE-413A-A08D-784E98C61010 --byType "iPhone 11 Pro" detox[63894] TRACE: [exec.js/EXEC_SUCCESS, #0] [
]
detox[63894] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
DetoxRuntimeError: Failed to find a device by UDID = "7C50BE35-0CDE-413A-A08D-784E98C61010" and by type = "iPhone 11 Pro"
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version. at SimulatorDriver._queryDevices (/Users/kondurc/Desktop/quicksightmobiletests/src/QuicksightReactNativeMobileTests/node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13) at process._tickCallback (internal/process/next_tick.js:68:7) detox[63894] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onAfterAll() detox[63894] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=6d94b773-5329-fab7-89ae-add64e14cdec detox[63894] DEBUG: [DetoxServer.js/WS_CLOSE] Detox server connections terminated gracefully FAIL e2e/specs/signinWithADUserTests.spec.js Sign In using Enterprise AD User - Reader role ✕ Should verify app is launched and Sign In button is available (4ms) ✕ Should Sign In with valid AD user from a reader group (15ms) ✕ Should enter Settings View Page (2ms) ✕ Should Sign Out (1ms)
● Sign In using Enterprise AD User - Reader role › Should verify app is launched and Sign In button is available
DetoxRuntimeError: Failed to find a device by UDID = "7C50BE35-0CDE-413A-A08D-784E98C61010" and by type = "iPhone 11 Pro"
HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone Xʀ" and avoid explicit search by OS version.
at SimulatorDriver._queryDevices (../node_modules/detox/src/devices/drivers/SimulatorDriver.js:224:13)
● Sign In using Enterprise AD User - Reader role › Should verify app is launched and Sign In button is available
ReferenceError: device is not defined
7 | describe('Sign In using Enterprise AD User - Reader role', () => {
8 | beforeEach(async () => {
> 9 | await device.launchApp();
| ^
10 | });
11 |
12 | it('Should verify app is launched and Sign In button is available', async () => {
at device (specs/signinWithADUserTests.spec.js:9:11)
at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
at Generator.invoke [as _invoke] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:271:22)
at Generator.prototype.(anonymous function) [as next] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:97:21)
at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
at invoke (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:135:20)
at ../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:170:11
at callInvokeWithMethodAndArg (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:169:16)
at AsyncIterator.enqueue (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:192:13)
at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:97:21)
at Object.<anonymous>.exports.async (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:216:14)
at Object._callee (specs/signinWithADUserTests.spec.js:8:14)
Upvotes: 1
Views: 2556
Reputation: 57060
As stated in the readme:
https://github.com/wix/AppleSimulatorUtils#troubleshooting
If Homebrew complains about a conflict in the wix/brew tap, run
brew untap wix/brew && brew tap wix/brew
and try installing again
Then upgrade applesimutils normally.
Upvotes: 3