How to set up Xcode 9 for iphone 4 and iphone 4s development?

孤街醉人 提交于 2019-12-05 01:47:08

问题


At a loss here. I have to test an app on iphone 4 devices as well as newer ones. Can anyone advise me as to how to set Xcode 9 up to support ios 7 as a deployment target as well as up to the newer versions of ios? So that I can use iphone 4 simulator and later test on the iphone 4 device?


回答1:


Can anyone advise me as to how to set Xcode 9 up to support ios 7 as a deployment target as well as up to the newer versions of ios?

The advice is simple: You can't. (Okay, maybe you can, with some sort of elaborate hacking; but don't.)

There's no problem running multiple versions of Xcode, so use an earlier version of Xcode to test on iOS 7. This will be tricky, because your project may not be easily backward compatible from Xcode 9 to an earlier version of Xcode, but it's your best hope. (Either that, or do what Apple really wants you to do: abandon backward compatibility beyond iOS 8.)




回答2:


Since iOS 9, Apple has stopped support of iPhone 4S.

To work with iPhone 4S with Xcode 9, you need to set Deployment Target for your build (TARGET) below iOS 9.0

Follow these steps to work with iPhone 4S with Xcode 9:

  1. Select your Project (Root) >> TARGET >> Tab 'General'
  2. Set 'Deployment Target' to 8.4



.


Now open Simulator List, You can see, iPhone-4S is there to work with it.

I suggest to work with latest stable version of iOS (iOS 10).




回答3:


Using latest xcode, you do not need to worry about supporting latest iOS version even if you choose lower deployment target which determines the app's backward compatibility.

It is a good idea to support the backward compatibility as far as your code is not depending on latest APIs and frameworks. The only reason for backward compatibility is to maximize the user base as not everyone (specially elders) update their iOS version regularly.

WARNING: If you choose lowest possible deployment target (8.0), some newer features and frameworks won't be able to behave as expected which increases the chances of app crashes in older iOS versions.

Currently, we are using Xcode 10.1. AND Xcode 10.1 supports iPhone4s.

(Please don’t confuse Xcode version (10.1) with the (iOS 10.1).

Xcode is an IDE which can have backward iOS SDK support.

The latest iOS we updated on our iPhone4s is 9.3.5

To test your code on device, you can simply connect an iPhone4s or you can download a simulator with iPhone4s support (9.0 or so)

To download additional simulators you can go to xcode > preferences > components Once the simulator is installed, the option for iPhone 4s would be available for testing.

TIP: We have been using Deploymate for maximum backward compatibility and support. It warns us about deprecated methods and this is where you start modifying your code to support the lowest iOS version with confidence.



来源:https://stackoverflow.com/questions/45640715/how-to-set-up-xcode-9-for-iphone-4-and-iphone-4s-development

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!