How to debug iOS 7.1 simulator on Xcode 7? - ios

I updated Xcode 7 and write some new code.
The problem is that my app support iOS 7.1, that require run from Xcode 6.4 to run iOS 7.1 simulator. But I can not run the app from Xcode 6.4 any more, because there's some new coding syntax that is only run from Xcode 7.
How can I debug my app for iOS 7.1.
Thank you!

Build your app in Xcode 7.
Quit Xcode 7.
Open up Xcode 6.4.
Launch the Simulator.app from Xcode 6.4
Run 'sudo xcode-select -s /path/to/Xcode-6.4.app'
Run 'xcrun simctl install booted /path/to/the/built/simulator.app'
Your app should be visible in the iOS 7.1 sim.

Xcode 7 doesn't have any code syntax. That's the iOS version. And If you are using any new API, your app will crash on lower versions.
Before using the newer API calls on existing framework objects, you may want to check respondsToSelector: on the object to avoid crashes. And you need to have a fallback method for lower API versions.
But if you are using iOS 9 only frameworks, Contacts framework for instance, you need to check the device's iOS version before using the framework to avoid crashes.

Related

This iPhone 6 is running iOS 11.3.1 (15E302), which may not be supported by this version of Xcode

I'm using Xcode 9.2 with Sierra 10.3.3 . And my iPhone 6 is with 11.3.1 (15E302). I'm unable to use my iPhone 6 for the test purpose of my IOS apps. Because, the Xcode says, Could not locate device support files. This iPhone 6 is running iOS 11.3.1 (15E302), which may not be supported by this version of Xcode.
Please help me if anyone have the device support for 11.3.1 (15E302)
Thanks
You need to update to Xcode 9.3.
Another option is to download the 11.3 device support
iOS 11.3
Remove "(15E217)" from folder name, so it became "11.3". Restart Xcode.
You need to upgrade your xcode version to make the app capable to run in that version of iPhone , or you can get the support files form Here and put in this path ( after unZip )
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Xcode 9.2 only supports up to iOS 11.2
Update Xcode

IOS simulator install sub version

I've got a running application which seems to crash only in IOS version 9.0.2. With version 9.0 it is working.
I want to debug it with the XCode simulator, but it is only running version 9.0.
How can I get the simulator running IOS 9.0.2?
You can't. You need a real device with the specific version. The simulator doesn't support minor point releases.

How to launch app using Xcode 7.1 with iOS Deployment target iOS 7.1?

I want to launch my app for users who have iOS 7.1 and ahead. After installing Xcode 7.1 after running on iOS 7.1 simulator its giving
The iOS 7.1 simulator runtime is not available.
Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator runtime.
After reading solutions of
How can I run the iOS 7.1 Simulator in Xcode 7.0 beta 2?
As you can see in comments also with El capitan and Xcode 7.1 its not working.
The only thing which i want here is my app should be available for iOS 7.1 and ahead users.
You will need a device with iOS 7.1 to check your app. If you have deployment target set to 7.1 it should run on that device with no problem.
Older Simulator runtimes are available for download through Xcode's preferences.
Goto Xcode -> Preferences -> Downloads to see the list of compatible legacy simulator runtimes.
El Capitan supports iOS 8.1 and newer runtimes.
Yosemite supports iOS 7.1 and newer runtimes.
There is a known issue mentioned in the Xcode release notes which prevents the iOS 7.1 simulator runtime from working in Xcode 7.
Thus, you can't currently use the iOS 7.1 simulator runtime with Xcode 7.

Xcode 6.4 "Could not download and install iOS 8.3 simulator"

I've been trying to install iOS simulators 8.3 & 8.4 on Xcode 6.3.2 an 6.4 beta respectively. In the first case is not even an option to download this simulator while in Xcode 6.4 it shows an error "Could not download and install iOS 8.3 Simulator. Authorization is required to install the packages". I've searched the web but I could not find anything so I tries reinstalling Xcode from Apple developer website as well as from the app store with no change at all. The only simulator I can use is 8.2. I cannot install any other version. Any help would be really appreciated.
This is the error on Xcode 6.4 with no additional option of iOS 8.4 Simulator
These are the simulator options for me to download which result in that error
These are my options in Xcode 6.3.2 with no option for iOS 8.3
I found a workaround on the Apple forums. If you run Xcode using sudo the simulator downloads and installs work just fine:
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
Note: Once the downloads and installs are complete you should quit Xcode and start it normally.
The iOS 8.3 Simulator runtime is includes in Xcode 6.3 (which is why it isn't offered as an additional download).
The iOS 8.3 Simulator runtime should be downloadable from Xcode 6.4, as you show. Your dialog box reports that there was an authentication problem when attempting to install the package. You need to provide administrator credentials when installing the package.
The reason you are getting your "iPhone 6 runs iOS 8.2 which is lower than -project name- minimum deployment target." errors is because you are selecting an iPhone 6 with iOS 8.2 on it and not an iPhone 6 with iOS 8.3 on it.
Use 'xcrun simctl create' or Xcode's Devices window to create the iOS 8.3 devices you need.

How to copy simulator from different Xcode version?

I have 2 XCodes installed on my Mac say Xcode 6.1 and Xcode 5.1. I use Xcode 6.1 iOS for development. For some bugs raised in iOS 7 I am in the need of iOS 7 simulator. Do I download Xcode 7 simulator When I have my iOS 7.1 simulator with my Xcode 5.1, or Would Xcode 6.1 will work When I copy my simulator from 5.1 to 6.1 ?
If that is possible tell me how?
Tnx in advance
For iOS version greater then 13
/Applications/OldXcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
Copy the simulator sdk you want, and paste it on the same path as above in another XCode version and rename sdk according to version.
Like For example i have version 13.3 i have to copy it to new xcode with version 13.4
Following will be the final path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.3.sdk
Also copy the runtime iOS.simruntime from
/Applications/OldXcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles
or
/Applications/OldXcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes
and paste it to the following path
/Users/waqasahmed/Library/Developer/CoreSimulator/Profiles
or
/Users/waqasahmed/Library/Developer/CoreSimulator/Profiles/Runtimes
and rename it according to the version like for version 13.3 it will be iOS 13.3.simruntime
Open path:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
copy the simulator sdk you want, and paste it on the same path as above in another XCode version.
You need to install the necessary simulators in each version of Xcode separately. Can use Xcode>Preference> Downloads option.
It is not possible to use the iOS 6 simulator runtime in new Xcode 7. The iOS 6 simulator runtime is not compatible with the new CoreSimulator architecture.

Resources