vietstone
vietstone

Reputation: 9092

How to debug iOS 7.1 simulator on Xcode 7?

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!

Upvotes: 2

Views: 942

Answers (2)

Desdenova
Desdenova

Reputation: 5378

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.

Upvotes: 0

Jeremy Huddleston Sequoia
Jeremy Huddleston Sequoia

Reputation: 23623

  1. Build your app in Xcode 7.

  2. Quit Xcode 7.

  3. Open up Xcode 6.4.

  4. Launch the Simulator.app from Xcode 6.4

  5. Run 'sudo xcode-select -s /path/to/Xcode-6.4.app'

  6. Run 'xcrun simctl install booted /path/to/the/built/simulator.app'

  7. Your app should be visible in the iOS 7.1 sim.

Upvotes: 5

Related Questions