简体   繁体   中英

Can't Create New iOS simulator on Xcode

I have this fresh installation of Xcode and I'm unable to create new simulators, I press the button to create any new simulator but nothing happens. I'm new on Mac but I have some experience on Linux, so if something need to be changed on terminal I think I can do it if you tell me what.

Create Simulator Screen: 创建模拟器屏幕

Components Screen: 组件屏幕

Also I'm having some other bugs, like, every time that I open Simulator I have this message "Unable to Determine Device".

尝试重启模拟器服务:

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

Can you file a radar and include the output of sudo sysdiagnose -q and xcrun simctl diagnose ? That last command might not work if you are on Xcode 8.2, in which case grab ~/Library/Logs/CoreSimulator/** . Also include the output of xcrun simctl list .

You should see some Simulators listed by default. The fact that you don't means there is something wrong with CoreSimulator or with Xcode's connection.

If simctl shows devices with no problems that is one thing. If it shows the default devices as unavailable then that is something entirely different. You can also run Simulator.app directly (Spotlight should find it for you) and see what devices it shows in the menu.

Close Xcode and Console.app. Run xcode-select -p and make sure it matches the location of Xcode, which should be /Applications/Xcode.app . If not, run sudo xcode-select -s <path_to_xcode.app> . Run sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService . Then open Xcode and see if you can see the devices listed.

You might also try reinstalling Xcode if nothing else works. Each version of Xcode ships with a built-in Simulator runtime for each platform. In this case 10.2, meaning you should have a number of iOS 10.2 Simulators pre-created and ready to use.

This is likely because your app's target is set to a version higher than the simulator supports.

For example below:

a. After adding ios simulator 11.2 and adding an iPhone 5s while the app's target is still 12.2, you can see the simulators on lower OS version doesn't show up. 目标定得更高

找不到添加的 iPhone 5s

b.After changing target to 11.2

改变目标

Added iPhone 5s now visible 现在可见

According to your first screenshot, you're trying to create an iPhone 4S simulator for iOS 10.2.

Trouble is, iOS 10 does not support iPhone 4S, iPad 2 and a few other devices .

You should be seeing an error thrown from Xcode that looks like this:

不兼容设备错误

Hopefully you already have other simulators from compatible devices for iOS 10.2 available to you on your Xcode setup.

The error was something with my current Mac User. I tried with another user and worked!

In my case I had symlinked my ~/Library/Developer folder to an external drive. Once I put that back to normal; Xcode and the simulator returned to normal behavior.

I know this question is old, but just in case... this is what worked for me:

When you have the option of pressing the create button and it doesn't work, tick the "Paired Apple Watch" button and click next. For some reason, merely the act of progressing to that next dialogue seemed to spawn all the available devices... no idea why unfortunately. You can then cancel the dialogue and pick one of the devices and it will build perfectly.

Hope this works for someone!

The different iPhones only support a certain versions of iOS. You have to find the supported version for iPhone 4s and download that same version of the iOS simulator in the Components screen - there is a small download arrow on the left side of the iOS version.

Eg The maximum supported iOS version for an iPhone 4s is iOS 9.3.5 so you need to download the iOS Simulator of that version (in your case the iOS 9.3 Simulator).

At least that worked for me.

Here is the link to see a list of the different Apple devices and their supported iOS versions: https://everyi.com/by-capability/maximum-supported-ios-version-for-ipod-iphone-ipad.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM