简体   繁体   中英

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!

  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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM