How To Download iOS Simulator To Fix Xcode Error Can’t Select iOS Simulator

After i upgrade my Xcode to version 10.3, i found all the iOS simulator which i used before has lost. And when i build or run the iOS app in Xcode, it will use Generic iOS Device only ( you can see it in below picture ), but i do not have a real iOS device connected to my Mac computer at all, so the build will failed. So i need to add iOS simulator to the Xcode again to build and run my iOS app. This article will tell you how to do it.

xcode build only generic ios devices

1. How To Download iOS Simulators Package In Xcode.

  1. Click Set the active scheme drop down list in Xcode toolbar, then click Download Simulators item.
    download ios simulator in xcode
  2. If you can not find the Download Simulator item at above picture, you can click Xcode —> Preferences menu item at Xcode top menu bar.
    xcode preferences menu item
  3. Then click Components tab to open iOS simulator download dialog like below. Click the down arrow before the iOS simulator which you need to download it, after download click Check and Install Now button to install it.
    download selected ios simulator in xcode

2. How To Add / Remove iOS Simulator From Xcode.

After download selected version iOS simulator package, by default it will install all the iOS simulator of that version in the Xcode, you can add more or remove special iOS simulator from Xcode follow below steps.

  1. Click Window —> Devices and Simulators menu item at Xcode top menu bar.
    xcode menu bar window - devices and simulators - menu item
  2. There are two tabs in the popup dialog window, click the Simulators tab, then click the plus icon ( + ) at bottom left corner of the popup dialog window to open add simulator dialog. Give the simulator a name, select related Device Type and OS Version, then click Create button to create a new simulator. After this action, you can see the newly created iOS simulator at left list panel.
    create a new ios simulator in xcode devices and simulators
  3. If you want to remove one iOS simulator, just right click it in left simulator list, then click Delete menu item in the popup menu list.
    delete ios simulator in xcode devices and simulators
READ :   How To Fix Xcode Error The Operation Couldn’t Be Completed, Unable To Log In With Account. The Login Details For Account Were Rejected. And No Profiles Were Found

3. How To Reinstall Downloaded iOS Simulator Package In Xcode.

If you want to fully remove one iOS simulator version package from Xcode and then reinstall it again, you can follow below steps.

  1. Open a terminal and go to directory /Library/Developer/CoreSimulator/Profiles/Runtimes, you can find all the downloaded iOS simulator package directory files in it like below.
    # go to iOS simulator package install directory.
    $ cd /Library/Developer/CoreSimulator/Profiles/Runtimes
    
    # display current directory path.
    $ pwd
    /Library/Developer/CoreSimulator/Profiles/Runtimes
    
    # list all the iOS simulator package directory files that has been installed.
    $ ls -l
    total 0
    drwxrwxr-t  3 root  admin  96 Sep  3 22:48 iOS 12.0.simruntime
    drwxrwxr-t  3 root  admin  96 Aug 14 21:59 iOS 12.1.simruntime
    drwxrwxr-t  3 root  admin  96 Aug 14 20:50 iOS 12.2.simruntime
  2. Then you can remove the iOS simulator packages which you do not need use below command.
    $ sudo rm -rf ./iOS\ 12.2.simruntime/
    Password:
  3. Now, you can restart Xcode to download and reinstall the removed iOS simulator packages which you need follow section 1 of this article.
    download selected ios simulator in xcode

4. How To Use The Newly Created iOS Simulator.

  1. After create iOS simulator follow above steps, when you click Set the active scheme drop down list at Xcode tool bar, you can find and select the iOS simulator to run your code.
    run xcode ios app use created ios simulators
  2. If you still can not find the iOS simulator that you added, this may be because you choose wrong iOS Deployment Target version than which you downloaded. You can change the iOS Deployment Target version by click the Xcode project name ( TestProject ) in Xcode left navigator pane, then click the project name ( TestProject ) in the center editor PROJECT pane, then click Info tab, and change the iOS Deployment Target version in the Deployment Target section.
    change xcode ios project deployment target version

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.