Installing Different versions of iPhone simulator - ios

I recently installed a new OS X on my mac, and installed XCode on it. It provided me only with iOs 6.0 simulator ( and maybe only iPhone 5, I don't really know how to change the simulated device ).
I have a couple of problems I encountered when porting an iPhone 4 project to this XCode, and I want to see if the problem is caused because of new changes in iOS 6/iPhone 5 or simply the code is wrong.
For that reason I want to be able to run the simulator with iOs 4 / iPhone 4, But I can't find a way to do that.
Any suggestions?

In Xcode go to:
Xcode -> Preferences -> Downloads
then Download the Simulator you need.

First of all, you're able to have same iPhone simulators (iPhone 4, 5, 5s, etc) with different iOS version (8.1, 10.1, 11.2, etc).
For latest Xcode, there are couple ways to do that:
XCode -> Preference (Command + ,) -> Components. Then install your desired simulators. All other ways will eventually open this window.
Click on your active scheme (pic. 1) -> scroll down to the bottom of the selection pop up (pic. 2) -> click "Download Simulators..."
Window -> Devices and Simulators -> Tab Simulators -> Click plus sign on bottom left corner to open "Create a new simulator" pop up window -> click "OS version" selection -> chose "Download more simulator runtimes ...".
I think by installing the runtimes, Xcode will eventually install all iPhone version that support it, down to iPhone 5.

You could install all simulator sdks quickly by copying files of sdks from others who has installed them. The file is located at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/. For instance of me:
songxiaofeng#xserver:~$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
songxiaofeng#xserver:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs$ ls
iPhoneSimulator5.0.sdk iPhoneSimulator5.1.sdk iPhoneSimulator6.0.sdk iPhoneSimulator6.1.sdk
After copy these files, restart your xcode, you will find these simulators. Good luck!

The way to do this in 2020 is to go to Xcode > Preferences > Components and click the download symbol on the versions you want to install.

Related

Xcode 10.3 failing to run on iOS 13 iPhone X - This iPhone X is running iOS 13.0 (17A577), which may not be supported by this version of Xcode

I updated to iOS 13 on my iPhone X and have Xcode 10.3 and am unable to run my project ton my phone. It gives me a notice of:
Could not locate device support files
and gives me this error:
This iPhone X is running iOS 13.0 (17A577), which may not be supported by this version of Xcode
I've looked everywhere, but since this release is new, how can I fix this?
Your version of Xcode does not have the supporting files for running iOS 13.
The easiest way to do that is to have Xcode 11 installed on your mac (or on someone else's mac) in addition to Xcode 10.3 (it's better to rename one of them)
Go to Applications folder, right click on Xcode 11 icon → Show Package Contents, navigate to folder Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
And copy the folder 13.0
Go back to Applications, right click on Xcode 10.3 icon → Show Package Contents, navigate to folder Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Now, paste that folder.
Quit Xcode and run again.
Happy Coding 👨‍💻
You should upgrade your Xcode to the latest 11.0 in App Store, which contain support for iOS 13.
I downloaded the Developer disk image for iOS 13.0 from here and added support file in Xcode Version 10.3 (10G8).
https://github.com/iGhibli/iOS-DeviceSupport/blob/master/DeviceSupport/13.0.zip
All other devices support list.
https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport
Follow These steps.
Unzip downloaded file. Right click on Xcode and click on Show Package Content. Then paste your file on path.
Applications -> Xcode.app -> Contents -> Developer -> Platforms -> iPhoneOS.platforms -> DeviceSupport Then at last restart your Xcode.
It works for me.

Simulator is not available error (Xcode 6.1)

I am about to upload the latest version of my app to the App Store, however up until this point I haven't done a whole lot of testing on iOS 7.
When I go to use the simulator, I am getting the error:
iPhone 4S is not available: Please select a different device and try again.
My deployment target is set correctly to 7.0.
Has anyone experienced this error? Any solutions?
Make sure you have the iOS 7 simulators installed. Navigate to Xcode -> Preferences -> Downloads -> Components and make sure the 7.0 and/or 7.1 simulators are downloaded. If there are check boxes next to each simulator, click "Check and install now" to see if any simulators need to be re-downloaded.
For those running Yosemite
The earliest simulator runtime supported on Yosemite is 7.1.
In XCode, from the menu, select: Xcode -> Open Developer Tool -> iOS Simulator
When sim is open from the menu, select: Hardware -> Device -> Manage Devices...
Click the + button, bottom left and add the devices/OSes you need.

How to run old simulators in Xcode 5 [duplicate]

Xcode 5 is behaving just fine, and I'm able to build and run apps on my iOS 7 device and in the iOS 7 simulator.
However, I do want to support iOS 6.1, but I don't see any way to build and run the apps for an iOS 6 simulator.
Things wot I've done:
Set Deployment Target to 6.1 for both Project and Target
Downloaded iOS 6 Simulator
Copied the iOS 6 SDK into Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Reset Content and Settings for the simulator
Originally, I was trying to see the app in the iOS 6 simulator by switching from iOS 7 to iOS 6 in the Hardware > Device menu in the iOS Simulator application, but there aren't any apps in the iOS 6 simulator.
I'm gathering from answers like this one that there should be something I can select before I click Build/Run.
I'd love to be able to see my apps in both iOS 6 and 7 simulators. Any ideas what I'm missing? Here's a LINK to what I see when I click on the simulator dropdown.
Turns out the solution was changing the deployment target for the project from iOS 6.1 to iOS 6.0, upon which the simulator scheme selection immediately showed the option to choose iOS 6 or 7 simulators. Basically the deployment target should match a simulator version that you have installed.
Thanks to random commenters in questions like this one who mentioned that that worked for them.
All you have to do is go to Xcode -> Preferences -> Choose the "Downloads" tab and install the iOS 6.0 Simulator.
Once you're done downloading it, it should show up as an option in your schemes.
Just a little caveat....I tried what you said but it didn't work for me...
Changed Deployment Target on "Project" from 7.1 to 6.0
Then I realised that Deployment Target was still set to 7.1 on the "Target" - once I changed that it worked!
Click to target or project > Build Settings > Achitecture > Supported Plateforms : change to iOS
What I did to get mine working was click on the scheme to the left of where the Simulators usually appear in the dropdown, then choose edit scheme.
A new window will display, make sure that Run is highlighted on the left and then click on the Info tab. Choose the .app file for Executable.
If you are still looking for a solution here's what worked for me:
From the xcode beta's pull down menus, Xcode > Open Developer Tool >
iOS Simulator (if you get a pop up error just dismiss it)
Once in the Simulator go to Hardware > Device > Manage Devices.
Delete everything listed under simulator.
Reboot your machine.
After that navigate back to Manage Devices in the simulator and click the plus to add back
your simulators. Then the iOS 8 simulators will show up.
This might help u out better..you have to copy paste iPhoneOS6.1sdk folder. This is for SDK, similarly instead of iPhoneOS.platform select iPhoneSimulator.platform and then the same path.
Please check whether your "Deployment Target" is higher than the ones available on your simulators.
Xcode5 neither has 6.0 SDK or 6.0 simulator. But what you can do is u can copy both 6.0SDK and 6.0 simulator from your previous Xcodes (xcode4.5 for 6.0 and XCode4.6 for ios6.1) You can find the simulator at /applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/applications/iphone simulator.app
And SDK at /applications/xcode.app/contents/developer/platforms/iphoneos.platform/devicesupport/6.0
Copy the entire folders for simulator and SDK in the exact same path of XCode5.
Note: to go the the Contents of Xcode.app just do a right click on the .app file and you will get an option"Show Contents".
Once u are done copy pasting, restart ur XCode5 and u can see 6.0/6.1 simulator as an option :)
Click on your project root.
Then Go to the Build settings.
Then set iOS deployment target 5.0
Then select iphone6 on top left of your project.
See this image
Solved restoring an older version of the xcodeproj file.

Xcode 5 not showing Scheme option to run Simulator on iOS 6

Xcode 5 is behaving just fine, and I'm able to build and run apps on my iOS 7 device and in the iOS 7 simulator.
However, I do want to support iOS 6.1, but I don't see any way to build and run the apps for an iOS 6 simulator.
Things wot I've done:
Set Deployment Target to 6.1 for both Project and Target
Downloaded iOS 6 Simulator
Copied the iOS 6 SDK into Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Reset Content and Settings for the simulator
Originally, I was trying to see the app in the iOS 6 simulator by switching from iOS 7 to iOS 6 in the Hardware > Device menu in the iOS Simulator application, but there aren't any apps in the iOS 6 simulator.
I'm gathering from answers like this one that there should be something I can select before I click Build/Run.
I'd love to be able to see my apps in both iOS 6 and 7 simulators. Any ideas what I'm missing? Here's a LINK to what I see when I click on the simulator dropdown.
Turns out the solution was changing the deployment target for the project from iOS 6.1 to iOS 6.0, upon which the simulator scheme selection immediately showed the option to choose iOS 6 or 7 simulators. Basically the deployment target should match a simulator version that you have installed.
Thanks to random commenters in questions like this one who mentioned that that worked for them.
All you have to do is go to Xcode -> Preferences -> Choose the "Downloads" tab and install the iOS 6.0 Simulator.
Once you're done downloading it, it should show up as an option in your schemes.
Just a little caveat....I tried what you said but it didn't work for me...
Changed Deployment Target on "Project" from 7.1 to 6.0
Then I realised that Deployment Target was still set to 7.1 on the "Target" - once I changed that it worked!
Click to target or project > Build Settings > Achitecture > Supported Plateforms : change to iOS
What I did to get mine working was click on the scheme to the left of where the Simulators usually appear in the dropdown, then choose edit scheme.
A new window will display, make sure that Run is highlighted on the left and then click on the Info tab. Choose the .app file for Executable.
If you are still looking for a solution here's what worked for me:
From the xcode beta's pull down menus, Xcode > Open Developer Tool >
iOS Simulator (if you get a pop up error just dismiss it)
Once in the Simulator go to Hardware > Device > Manage Devices.
Delete everything listed under simulator.
Reboot your machine.
After that navigate back to Manage Devices in the simulator and click the plus to add back
your simulators. Then the iOS 8 simulators will show up.
This might help u out better..you have to copy paste iPhoneOS6.1sdk folder. This is for SDK, similarly instead of iPhoneOS.platform select iPhoneSimulator.platform and then the same path.
Please check whether your "Deployment Target" is higher than the ones available on your simulators.
Xcode5 neither has 6.0 SDK or 6.0 simulator. But what you can do is u can copy both 6.0SDK and 6.0 simulator from your previous Xcodes (xcode4.5 for 6.0 and XCode4.6 for ios6.1) You can find the simulator at /applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/applications/iphone simulator.app
And SDK at /applications/xcode.app/contents/developer/platforms/iphoneos.platform/devicesupport/6.0
Copy the entire folders for simulator and SDK in the exact same path of XCode5.
Note: to go the the Contents of Xcode.app just do a right click on the .app file and you will get an option"Show Contents".
Once u are done copy pasting, restart ur XCode5 and u can see 6.0/6.1 simulator as an option :)
Click on your project root.
Then Go to the Build settings.
Then set iOS deployment target 5.0
Then select iphone6 on top left of your project.
See this image
Solved restoring an older version of the xcodeproj file.

Xcode/Simulator: How to run older iOS version?

I'm thinking of upgrading to iOS SDK 4.2. But what I'm wondering is if I'll still be able to run the simulator as iOS 3.2. This is because I'm creating iAds for iPad but I still want to check if my program will run with iOS 3.2.
Note: I have seen a similar post to this in the past, but they weren't really helpful in giving the exact steps in how this could be done.
To anyone else who finds this older question, you can now download all old versions.
Xcode -> Preferences -> Components (Click on Simulators tab).
Install all the versions you want/need.
To show all installed simulators:
Target -> In dropdown "deployment target" choose the installed version with lowest version nr.
You should now see all your available simulators in the dropdown.
XCODE 10.1
1. Goto Xcode -> Preferences (Shortcut CMD,)
2. Select Components
3. Download Simulator version
4. XCode -> Open Developer Tool -> Simulator This will launch Simulator as stand alone application
5 Hardware -> Device -> Manage Devices...
6. Click on + iCon to create new simulator version.
7. Specify Simulator Name, Device Type and Choose OS version from drop down.
8. Click Create.
9. Hardware -> Device -> iOS 11.0 -> iPhone 6
Thats it run enjoy coding!
If you have iAds in your binary you will not be able to run it on anything before iOS 4.0 and it will be rejected if you try and submit a binary like this.
You can still run the simulator from 3.2 onwards after upgrading.
In the iPhone Simulator try selecting Hardware -> Version -> 3.2
Xcode 14:
Xcode -> Preferences -> Platforms
Then click the + button
Open xcode and in the top menu go to xcode > Preferences > Downloads and you will be given the option to download old sdks to use with xcode. You can also download command line tools and Device Debugging Support.
In XCode under Targets, right-click on your project and Get Info. Under the Build tab look for iOS Deployment Target. By changing this you should be able to test different iOS version.
I was searching for how to do this on a much newer version of xcode than the original question and while the answers here got me where I needed to go, they aren't quite accurate for location anymore. Xcode 11.3.1, you need to go into Preferences -> Components, then select the desired Simulators. You can also select tvOS and watchOS similators from the same window.
To add previous iOS simulator to Xcode 4.2, you need old xcode_3.2.6_and_ios_sdk_4.3.dmg (or similar version) installer file and do as following:
Mount the xcode_3.2.6_and_ios_sdk_4.3.dmg file
Open mounting disk image and choose menu: Go->Go to Folder...
Type /Volumes/Xcode and iOS SDK/Packages/ then click Go. There are many packages and find to iPhoneSimulatorSDK(version).pkg
Double click to install package you want to add and wait for installer displays.
In Installer click Continue and choose destination, Choose folder...
Explorer shows and select Developer folder and click Choose
Install and repeat with other simulator as you need.
Restart Xcode.
Now there are a list of your installed simulator.
Choosing older simulator versions is not obvious in Xcode 3.2.5. Older Xcodes had separate lists of "iOS Device SDKs" and "iOS Simulator SDKs" in the "Base SDK" build setting popup menu, but in Xcode 3.2.5 these have been replaced with a single "iOS SDKs" list that only offers 4.2 and "latest".
If you create a new default iOS project, it defaults to 4.2 for both Base SDK and Deployment Target, and in the "Overview" popup in the project's top-left corner, only the 4.2 Simulator is available.
To run an older iOS simulator, you must choose an older iOS version in the "iOS Deployment Target" build setting popup. Only then will the "Overview" popup offer older Simulators: back to 4.0 for iPhone and to 3.2 for iPad.
Xcode (14.1v) -> Settings -> Platforms -> + Icon
The simulator CANNOT be downloaded from:
Xcode -> Preferences -> Downloads
Only the iOS devices symbols. As this option says:
This package includes information and symbols that Xcode needs for
debugging your app on iOS devices running versions of iOS prior to iOS
4.2. If you intend to debug your app on a device running one of these versions of iOS you should install this package.
That is, you need an iOS 4.2 device to test an iOS 4.2 application

Resources