How do I run an iPad Simulator in Xcode? - xcode

I am trying to run an iPad simulator on Xcode, but currently I only have one option when I go to Xcode > Open Developer Tool > Simulator, which launches the iPhone simulator.
How do I launch the iPad simulator?

You should select an iPad device by navigating to
Hardware/Device/[OS version if you have multiple OS versions installed]/[device]
in the simulator's menu.
If there are no iPad devices in the list, follow these instructions:
Click on Hardware/Device/Manage Devices...
Select the Simulators option on the top.
Press the plus (+) sign in the lower-left corner.
Define the name, the device type and the OS version of the new simulator, then click on Create.
For more information, check out Getting started in Simulator.

This is for Xcode 11.2.1+
open XCode, from the App menu:
Xcode -> Open Developer Tool -> Simulator
This will open the latest iPhone simulator and to change it to anything else e.g iPad:
Hardware -> Device -> iOS -> iPad

This has changed.
Now, after you opened your simulator as you mentioned you need in the simulator menu bar to go to:
File -> Open Simulator -> [ios version] -> [ios device]
There you can find an ipad simulator to open.

For bonus points :)
I would also extract the simulator from inside Xcode to make it more accessible.
Applications / Xcode.app ( right click and select "Show Package Contents" )
From this folder Contents / Developer / Applications / Simulator.app
Create a shortcut to that and simulator opens without opening the main Xcode.app

Open Simulator, go to File > Open Simulator > {Your version of IOS} > {Device you want}.
Dont Forget to rebuild your app before trying to launch it.

Related

I can't find simulator on swift

I can't find simulator on swift I install simulator version 15
but my simulator list only have any iOS device(arm 64)and my Mac
I don't know how to add simulator to my list please help me
From the top left
Xcode > Preferences > Components
and install the most recent simulator from the list.
Then go to Window > Devices and Simuators > Simulators and tap on + icon on the bottom left and create a new simulator.
Seems like you open the framework/app which has already setup their deployment target. Which current device of yours doesn't have this.
Open xcode project and go to tab Info -> Deployment target -> iOS Deployment Target -> change iOS version

How to add simulator iPhone XS in Xcode 9.2 also iPhone XS max

I need to build my app on an XS device. I am using Xcode 9.2.
How can I add the XS modal in my Xcode externally?
In my simulator I have up to iPhone X.
My machine Version:
OS X version: 10.12.6 (16G29)
Xcode version: 9.2
Simple solution:
Open Xcode.
Select the "Window" menu.
Select "Devices and Simulators".
Select Simulators tab.
Click on the "+" icon at the left bottom.
Choose the desired device & preferred iOS.
Click "Create".
Enjoy :).
For those here with the same problem but for Xcode 10.x and need iOS 13 simulators (iPhone 11, for instance) do the following:
Install and open Xcode 11
Go to Xcode menu > Open Developer Tool > Simulator
On the Simulator app, go to Hardware menu > Device > iOS 13 to select and run your desired device
Now you can close Xcode 11, and open Xcode 10.x
You should see your i.e iPhone 11 simulator available in the Device List as the image:
In Xcode go to Window > Devices and Simulators
Here click on the simulators and then click on '+' to add a desired device.
Update 2020
Open xcode simulator
File > Open device > select your desired device.
for that u need to upgrade your xcode version to xcode 10, thats not available for xcode 9.2
For Simulator iPhone Xs 13.3 is not available by default in simulators list, So we would have to create it.
Steps :-
•Xcode Menu -> •Open Developer Tool -> •Simulator ->• Hardware -> •Device -> •Manage Devices -> •Simulators -> •Left Column -> •Click on + to create your device -> •Add Simulator Name (possibly iPhone Xs 13.3)…Device type to be iPhone Xs and OS Version iOS 13.3 -> •Create
Your New Device will be available in the list of Devices.
Similarly we can create other devices too.
[xcode]
iPhone XS simulator is available on XCode 10 and above.
We can’t able to create a iPhone XS simulator on below XCode 10
But we can add
iOS 12.0 simulators in XCode 9.3

Xcode 9 Beta 3 - Where is iOS11 Simulator?

I have just installed XCode 9 beta 3.
But I don't see an iOS 11 version under Pref, Components.
How can I setup an iOS simulator?
1) Open the Devices and Simulators window:
Window -> Devices and Simulators
2) Click the plus in the lower lefthand corner
You will see dialog to add a new simulator
3) Select a device (i.e. iPhone 7) that supports iOS 11 and click create
I had a similar issue only seeing iPhone 5 and 6 sims and not able to create / download iPhone 7 simulator with iOS11. My solution was to move Xcode 9 beta 3 from the downloads folder into the Applications folder along side xcode 8. I didn't realise it was still in the DL folder. Once launched from the Applications folder Xcode 9 beta 3 loaded with all the sims in place. Worth checking if your's is still in the downloads folder too with a previous version of Xcode in the Applications folder.
Follow these steps to add a (new) simulator
Click on Simulator icon and open simulator list.
At the end of list, there is an option to add new simulator "Add Additional Simulator". That will open 'Device & Simulator' window.
Switch to 'Simulator' tab.
There are three field in simulator tab.
Click on '+' icon, on left bottom corner of window.
Simulator Name: Enter simulator name here
Device Type: Select iPad from this dropdown list
OS Version: Select OS version from this dropdown list
Click on 'Create'
A new simulator will be added in your Simulator option list.
Look at this snapshot to understand flow of above steps:
And if there is no simulator/OS version in simulator list, you're looking for,
Click on Simulator icon and open simulator list.
At the end of list, there is an option to add new simulator "Download Simulator". That will open 'Component' window (from Xcode >> Preferences).
Select/click simulator from list, which you need to download.
Look at this snapshot:

Can I set the default simulator for new projects in Xcode 7.1 or latest?

I've been making a ton of new projects as I'm learning Swift. My development is all on my laptop, so I hate using the default 6s Plus simulator, since the window is too big to easily see. Is there a way to change the default simulator to be a different one for new projects?
No need to delete simulators!
Product → Destination → Add Additional Simulators...
In the sidebar, select the simulator you want to hide
Uncheck "Show as run destination"
Edit: Updated for Xcode 10
You can select the desired simulator via the Hardware > Device > [OS] menu (Xcode 9):
While unchecking "Show as run destination" hides the simulator, this will also change the default value.
Updated image for Xcode 11.5
Xcode 9 UPDATE:
In Xcode 9, no need to delete simulators, and the way to turn them on/off is to go in Product/Destination/Add Additional Simulators... select the simulator you want to turn off, then uncheck the box: 'Show as run destination'
No. But...
If you don't like the size of the 6s plus simulator, make it smaller with the simulator Window Scale menu.
If you don't like the 6s plus simulator at all, delete it with the Xcode Window Devices menu.
Xcode 12.5
In Xcode, go to Product -> Destination -> Choose Destination menu and selecting the device you'd like to be your default.
The original answer could be found in apple support forum here: Apple support forum,
In addition if you want to make the device smaller just hover over bottom right corner of the simulator and you will see the resize option
Deleting the simulators you don't want will default you to the simulator you do want. I also develop on my laptop and the biggest simulator I can see w/o scaling down is the 4S, so I deleted simulators for iPhone 5 and above and now every project I create defaults to 4S simulator. If I ever need the newer simulators, I will just re-download.
In my case, just select the device in Product → Destination, Xcode 12.4
Xcode version 11.5
On Simulator > File > Open Device > iOS 13.5 > Change the default Simulator
Xcode(v11.5)
open your simulator, choose **File/Open Device/iOS 13.5/iPhone8 ** will change your simulator device to iPhone 8.
When you reopen your simulator, iPhone 8 will be your device simulator.

How to run Xcode 6.2 simulator?

At the top next to the play/run button, I only have an option for "iOS Device". The simulator is not an option. How do I run projects in the simulator?
You can manually start the simulator from the task bar. I think its under File -> Developer Tools -> iOS Simulator.
Also make sure your deployment target is set to the simulator's firmware.
If still you can't use the simulator you can tap on iOS Device and then add scheme. There you will be able to add simulators, even though this should have been there by default.

Resources