Can't get detox to find iPhone X or simulators older than iPhone 11 - detox

Getting this error after accepting the licensing from XCode for upgrading with iOS 13 and iPhone 11. I have no problem running the detox tests against an iPhone 11 device using "iPhone 11" as the name value in the detox configuration.
Error: Can't find a simulator to match with "iPhone X", 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"```
ran xcrun simctl list and iPhone X is definietly in there and booted:
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone 8 (com.apple.CoreSimulator.SimDeviceType.iPhone-8)
iPhone 8 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus)
iPhone X (com.apple.CoreSimulator.SimDeviceType.iPhone-X)
iPhone Xs (com.apple.CoreSimulator.SimDeviceType.iPhone-XS)
iPhone Xs Max (com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max)
iPhone Xʀ (com.apple.CoreSimulator.SimDeviceType.iPhone-XR)
iPhone 11 (com.apple.CoreSimulator.SimDeviceType.iPhone-11)
iPhone 11 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro)
iPhone 11 Pro Max (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max)
...
```-- iOS 12.2 --
iPhone 5s (B9F8AD52-F3A4-4E5A-B6EC-406827678E41) (Shutdown)
iPhone 6 Plus (D5C54611-B44F-4F42-A400-FA6B3F10877A) (Shutdown)
iPhone 6 (E29542E6-163D-4ABD-8825-78975A22934D) (Shutdown)
iPhone 6s (B6D65541-1EB4-43A7-B738-28A215AE50D4) (Shutdown)
iPhone 6s Plus (C1C0488F-7810-4552-B404-F344D36B1215) (Shutdown)
iPhone 7 (7A5DDC90-60BD-4B9A-9CEC-62C924EB86DF) (Shutdown)
iPhone 7 Plus (D19DABA8-AA67-454D-904E-760D202A148A) (Shutdown)
iPhone 8 (37F662FE-7368-46E2-AE87-4C1EC561DB07) (Shutdown)
iPhone 8 Plus (E7F29F60-E1E3-4206-875C-CE0CD0FDD2B5) (Shutdown)
iPhone X (13DD7A53-D818-444D-A537-633365C9DFA8) (Booted) ```
Did detox drop support for running against other iPhone simulators?
I've updated applesimutils and removed and re-added the iPhone X device with iOS version 12.2, but still same error.

I have also faced this issue and resolved it with the below command.
brew tap wix/brew
brew install applesimutils
Also, I am using XCode 12.4 and detox 18.7.1.

I'm seeing the same behavior with Detox 14.3.4. I'm assuming that is the version of Detox that you're using.

Fix for me is here: https://github.com/wix/Detox/issues/1675
Coyping solution here as well:
"Setting the name for the simulator in the Detox config to "iPhone 5s,iOS 11.3" vs "iPhone 5s" fixed it for me. It seems deviceInfo.newestRuntime.version in Detox's AppleSimUtils.js will return the latest OS version despite whether a simulator exists for that version or not."

Detox was recently updated with new device selection API in package.json. Please migrate to that.

Related

Could not find XXXXXXX simulator

The last 2 days I've been banging my head on this, and since I had to dig through gitHub issues to find my fix, I'm putting it here so it will hopefully help someone else.
I can run all of the other simulators I use, but recently have found some UI bugs specific to the iPad Pro 11-inch model. So I've been trying to launch that simulator specifically to no avail. I'm getting this error:
error Could not find iPad Pro (11-inch) (6F2D27E4-32D8-4B7D-B268-1B0713EB97F1) simulator. Run CLI with --verbose flag for more details.
I tried logging the steps in the react-native run-ios findMatchingSimulator.js file. Could not figure out what was going on, but logging my devices list there showed a ton of inactive devices, plus the list of active devices I knew.
Running xcrun simctl list devices gave me the following output.
== Devices ==
-- iOS 12.2 --
iPhone 5s (C5826171-13BE-41EA-901B-7B43696C3C01) (Shutdown)
iPhone 6 (BD534AAE-6F9B-4C84-AC46-4D3CD247FEAE) (Shutdown)
iPhone 6 Plus (089315D2-EE75-4A3F-A4B2-8740D4756277) (Shutdown)
iPhone 6s (5691F6FD-608D-48EF-A7E9-817E17EE7AF3) (Shutdown)
iPhone 6s Plus (42D3F69D-6647-4C27-9B06-E2D85589152C) (Shutdown)
iPhone 7 (7D564E89-7860-4A39-9BB2-7CF03FAB7554) (Shutdown)
iPhone 7 Plus (9004541C-4555-4D54-8516-09F5EAA37130) (Shutdown)
iPhone 8 (C77E9475-668B-4FBC-AFDF-A9988DD9F43C) (Shutdown)
iPhone 8 Plus (F908AFA2-2BF0-4ADC-A4F6-ED32F76125F7) (Shutdown)
iPhone SE (6D7A9107-A67F-4684-B5B8-99FC3BED357E) (Shutdown)
iPhone X (9619A1FF-5ECC-4672-B760-CB27D3303D2D) (Shutdown)
iPhone Xs (5C32E392-2721-4B63-A096-82C4A548D603) (Shutdown)
iPhone Xs Max (701C2CCE-388B-4D7D-8C7C-2954BBC72461) (Shutdown)
iPhone Xʀ (DBEAAE0F-AF30-4198-AECB-5A62A4179028) (Shutdown)
iPad mini (5th generation) (1A96F4E4-FD2E-49E1-A93C-1FF10F229355) (Shutdown)
iPad Air (3rd generation) (88ACC19B-6F49-457E-8B15-6B337E026EFC) (Shutdown)
iPad Air (F35E0A98-AEB9-49FA-BE9E-0C36E37B615E) (Shutdown)
iPad Air 2 (6D647415-2903-42DA-A90E-F6067B9B47C7) (Shutdown)
iPad (5th generation) (16B5F02E-90E9-41E7-AA2B-FA4E605C8AF4) (Shutdown)
iPad Pro (9.7-inch) (63360396-407D-461F-8D62-243D584EB6C9) (Shutdown)
iPad Pro (12.9-inch) (9A220CF0-0BA6-4F98-B395-4343F20FD124) (Shutdown)
iPad Pro (12.9-inch) (2nd generation) (0C7F2F61-74C8-4B51-92DB-B3EA5D26A03A) (Shutdown)
iPad Pro (10.5-inch) (6BF39DD9-806B-442B-AE26-10854EB0FF96) (Shutdown)
iPad (6th generation) (0DAA2D70-D814-4B8E-ACB3-B7238CB6AA1F) (Shutdown)
iPad Pro (11-inch) (6F2D27E4-32D8-4B7D-B268-1B0713EB97F1) (Booted)
iPad Pro (12.9-inch) (3rd generation) (CCDC4BD6-72B9-4CB5-A809-960F08B39E4F) (Shutdown)
-- tvOS 12.2 --
Apple TV (8A172120-ED91-4B54-84EA-19CC25363740) (Shutdown)
Apple TV 4K (3E104BFD-D8B3-42BC-AD3F-743DDEFF1BCC) (Shutdown)
Apple TV 4K (at 1080p) (B1BCC24F-7D88-4710-8EC8-3F01EFBBB5B5) (Shutdown)
-- watchOS 5.2 --
Apple Watch Series 2 - 38mm (8D48AA77-4C92-4135-B8B9-48830933E555) (Shutdown)
Apple Watch Series 2 - 42mm (693BDC3F-BAB1-46C3-8AAC-BDF507F4A3F4) (Shutdown)
Apple Watch Series 3 - 38mm (5857A791-2C83-410F-9672-3A28B6E85170) (Shutdown)
Apple Watch Series 3 - 42mm (80282B84-D01E-4399-9235-61B74370EB22) (Shutdown)
Apple Watch Series 4 - 40mm (DC520F96-889A-468A-8C0D-4DE52FA2164A) (Shutdown)
Apple Watch Series 4 - 44mm (6FB6B0DC-F63E-4A27-8F74-FE500286368B) (Shutdown)
As you can see, the simulator I tried running is in this list, but I still get an error trying to run react-native run-ios while specifying that simulator.
After walking through all kinds of GitHub issues, I happened upon a fix.
The fix was noted because the user with the fix had multiple devices in different OS's. I don't have that, all mine that show up are in the same OS, 12.2, but I figured I'd give it a try.
I change my iPad Pro 11-inch alias from:
react-native run-ios --simulator='iPad Pro (11-inch)'
to:
react-native run-ios --simulator='iPad Pro (11-inch) (12.2)'
and voila, it works. I'm guessing that the deactivated ipad 11 that is a different OS was the problem, but search me as to why my other simulators work, since they also had deactivated dupes in different OS's.

How to choose which iPhone model simulator to run my react native app?

I am working on react native app, and I do testing on iOS Simulator.
However, it always runs on iPhone 6, and i don't know how I can switch to other iPhone models like iPhone 6 Plus or 5.
I can start a different device manually by going to Simulator -> Hardware -> Device -> iOS -> iPhone 6 Plus.
But the app is installed only on iPhone 6, and it always starts iPhone 6 when I run react-native run ios.
How can I change it so that I can run the app on different iOS Simulator devices?
react-native run-ios --simulator="iPhone 6s Plus"
As far as I can tell there is currently no way to specify the OS.
you could open your project in Xcode on mac and choose build target, then build.

Adaptative layout iOS 8 and iOS 7

I've to develop an app that should work on iOS 7 and iOS 8 devices. I'm using Xcode 6 to develop it and I'm having issue to design the UI. I designed the UI by using the adaptive layout, so when I try to run the app on a device in which it's installed iOS 8 it works great on all display dimension (iPhone 4s, iPhone 5, 5c, 5s and iPhone 6, 6 Plus) as you can see on the following screenshot:
When I try to run it on a device in which it's installed iOS 7 I get some trouble as you can see on the following screenshot:
How I can fix that issue? I need to design another Storyboard that the system should use if it detect iOS 7? I hope you can help me

New Xcode 6 Project - How to run in the iOS 7 Simulator

I try to create a new project with Xcode 6 that also runs on iOS 7. I've created a new project and then did the following:
Set Project's iOS Deployment Target to 7.0
Referenced a Launch Image Source in the Assets
Still, when trying to run on an iOS 7 simulator, the following error is shown:
"iPhone 5s not available. Please select a different device and try again."
(My older projects run fine on iOS 7 simulators.)
How I can make a new project run in the iOS 7 simulator?
EDIT
The output of xcrun simctl list is the following:
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
Resizable iPhone (com.apple.CoreSimulator.SimDeviceType.Resizable-iPhone)
Resizable iPad (com.apple.CoreSimulator.SimDeviceType.Resizable-iPad)
== Runtimes ==
iOS 7.0 (7.0 - Unknown) (com.apple.CoreSimulator.SimRuntime.iOS-7-0) (unavailable, runtime path not found)
iOS 7.1 (7.1 - Unknown) (com.apple.CoreSimulator.SimRuntime.iOS-7-1) (unavailable, runtime path not found)
iOS 8.0 (8.0 - 12A365) (com.apple.CoreSimulator.SimRuntime.iOS-8-0)
== Devices ==
-- iOS 7.0 --
iPhone 4s (9A55186B-9B91-4526-A2AB-EF0C49F592A4) (Shutdown) (unavailable)
iPhone 5 (D326EE14-21DA-4FA5-A229-F0BACDA6C9F3) (Shutdown) (unavailable)
iPhone 5s (1AC03181-38D5-4C24-9928-4EFDE83D0ACD) (Shutdown) (unavailable)
iPad 2 (212A00A7-1D1F-4392-8AE6-24C46EA9A507) (Shutdown) (unavailable)
iPad Retina (9471D6C8-DDE7-4D08-B015-89CA02ED4C46) (Shutdown) (unavailable)
iPad Air (E84ADD9C-7BA4-4EBF-B98E-DB6EAF99EFA6) (Shutdown) (unavailable)
-- iOS 7.1 --
iPhone 4s (836A9B30-D104-4D54-98A2-479F7F35F4EC) (Shutdown) (unavailable)
iPhone 5 (39EB7E74-4665-492B-9097-F454D083CFD8) (Shutdown) (unavailable)
iPhone 5s (DAE6E1F3-E4F1-4D4F-9C16-73B495A08415) (Shutdown) (unavailable)
iPad 2 (D34D496D-39CA-4D2E-9C6A-C5EB7B62C8DC) (Shutdown) (unavailable)
iPad Retina (8EFF2BF2-F639-46C2-AB21-8B28858DF778) (Shutdown) (unavailable)
iPad Air (434AB478-DD08-481D-A75D-3EA94A440814) (Shutdown) (unavailable)
-- iOS 8.0 --
iPhone 4s (EEAA9E7C-867E-4E71-99CE-A5C729FB2F21) (Shutdown)
iPhone 5 (DA90266D-1FF5-4E84-B806-DBE49F1A86DB) (Shutdown)
iPhone 5s (B673A5D8-7992-41AE-9B43-200C064ECFDA) (Shutdown)
iPhone 6 Plus (19F9C682-B4D8-488B-82C4-8B5BAD8D38FB) (Shutdown)
iPhone 6 (2FCC7DD6-2274-4B7F-A151-1A49AB31AE65) (Booted)
iPad 2 (801852DD-7EFA-4336-9686-42C5D65DAABD) (Shutdown)
iPad Retina (314D3C76-6D20-466B-AD61-567CE202556F) (Shutdown)
iPad Air (5B47FA82-F1F6-43C2-A373-BABBEFA0AB22) (Shutdown)
Resizable iPhone (8F4B8FAF-AEB9-4782-AC09-6F8B4BDD37AA) (Shutdown)
Resizable iPad (DEBDB255-8650-4B8D-B161-D9FA26331ACD) (Shutdown)
I meet this problem too.
Preferences -> Downloads -> Components
Then click the download button.
If you've downloaded them before, Xcode will install them directly.
Maybe you've just update your Xcode.
Xcode 6 is not installed 7.x simulators as default. However, you installed them on previous version Xcode.
In the Devices window, delete all devices one by one. Now add them back one by one. Now restart the computer (not just Xcode). This will leave you with only good devices and you'll know whether you need to download the older simulators.
I resolve this issue by performing the following steps:
1) From my Xcode 6.1 --> Opens available simulators/devices Devices List.
2) Then Click on the bottom of the list more simulator button --> Download simulator windows opens.
3) Download your desire simulator 7.0 or 7.1 or both.
If simulators downloaded before,then Xcode will install them automatically.
Check the Screen Shots:
Hope this will help you out cheers.
Based on the output of simctl list, you should see the 8.0 simulators in Xcode but not the 7.x simulators. The 7.x simulators will appear once you download and install the 7.x simulator runtimes.
I face the same problem. And I have fixed it. When you update to Xcode 6.0+, the Xcode will break the runtime of iOS 7 simulators. Though you have the Devices of iOS 7.1 but without runtime, the simulators are not available. You must download the 7.1 runtime again.
But we all know download the simulators in Xcode is very painful. An easier way is to copy the "iOS 7.1 SDKs" form other's Mac (in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs).

how to get ios 5.1 into xcode simulator?

iOS 5.1 was just recently released and I want to test it on my simulator but the highest available is iOS 5.0. I went to the developer centre to download it but all I could find was a list for sdk iOS 5.1 for devices (ipad, iphone, ipad 2 etc etc).
How do I get 5.1 into my simulator?
thanks!
You have to install Lion and the new Xcode 4.3.1.