Repository: wix/Detox

Issue #1103: Incorrect OS version of specified iPhone simulator name
Created: 2018-12-30T13:15:36Z
Detox/detox/src/devices/ios/AppleSimUtils.js
    
    
         Line 38
      in
      45c895a
    
  
  
    

        
          
           const deviceInfo = await this.deviceTypeAndNewestRuntimeFor(query); 
        
    
  


E.G;

delete iPhone 8 iOS 12.1 simulators
pass only device name; iPhone 8

When other devices have 12.1 simulators installed for them, 12.1 will be picked even though device won't match;
 Error: Can't find a simulator to match with "iPhone 8", run 'xcrun simctl list' to list your supported devices.
      It is advised to only state a device type, and not to state iOS version, e.g. "iPhone 7"
    at AppleSimUtils.findDevicesUDID (/Users/jonathanl/Desktop/dev/crm/invoices-mobile/node_modules/detox/src/devices/ios/AppleSimUtils.js:47:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

Duplicate issue #1469: Can't find a simulator to match with...
Created: 2019-06-21T16:58:17Z
Description
A clear and concise description of what the bug is. If you are seeing a regression, try to provide the last known version where the issue did not reproduce.
Using the Ignite-CLI Bowser template,  when I try to run yarn test:e2e  (while I have a iPhone X simulator running;  I have Xcode 10.2.1, applesimutils 0.6.8),   I get this error.  NOTE: When I run xcrun simctl list, the output seems fine.
detox[2686] ERROR: [index.js/DETOX_INIT_ERROR]
 Error: Can't find a simulator to match with "iPhone 8", run 'xcrun simctl list' to list your supported devices.
      It is advised to only state a device type, and not to state iOS version, e.g. "iPhone 7"
    at AppleSimUtils.findDevicesUDID (/Users/jausten/Temp/TABA/node_modules/detox/src/devices/ios/AppleSimUtils.js:47:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)

To Fix, I had to  remove the  --byOS "${os}"  param from line 47 in the AppleSimUtils.js ,  as suggested by the above error message.  Don't you think it is wierd that the error message I get basically says I need to edit/modify the AppleSimUtils.js file, on line 47?
Expected Behavior
I expected the applesimutils to have no trouble detecting my running simulator.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment

macOS version: 10.14.5
Xcode version: 10.2.1
AppleSimUtils 0.6.8

Closing comment (2019-06-21T17:18:47Z): Hello,
You seem to have confused several things.
First, you have posted a Detox problem on the AppleSimulatorUtils issue tracker. Second, the text you have quoted does not say you should edit AppleSimUtils.js, it tells you where the error was thrown. As with any exception, it tells you where the exception was thrown. Last, you seem to misunderstand how Detox chooses the simulator to use. It takes the string you have provided in your package.json, matches it against the full simulator list (in your case, this step has failed), after a successful match, Detox takes the simulator ID and calls commands directly with that ID. In your case, by removing the OS param, you have effectively set permissions to all "iPhone X" devices. This issue seems like a duplicate of #1103 and will be now moved to Detox and closed as such.
As a workaround, please provide an explicit name and OS, such as "iPhone X, iOS 12.0".
Thanks