[英]how to deploy and debug an iOS app on iPhone 4 using Xcode 6
I have an app which is crashing on iPhone 4 having 7.1 installed , i want to debug app on phone using xcode 6, is it possible(as it shows unavailable currently) ? 我有一个在安装了7.1的iPhone 4上崩溃的应用程序,我想使用xcode 6在手机上调试该应用程序吗(可能显示为当前不可用)? if not what are the options I am left with ?
如果不是,我还有什么选择?
There is no option for an "iPhone 4 Simulator" in Xcode 6. But, if you use an iPhone 4S simulator with iOS 7.1, you can achieve the same effect, because with the same screen size and OS they are essentially the same for testing on the simulator. Xcode 6中没有用于“ iPhone 4 Simulator”的选项。但是,如果您将iPhone 4S Simulator与iOS 7.1一起使用,则可以实现相同的效果,因为在相同的屏幕尺寸和操作系统下,它们在测试中实质上是相同的在模拟器上。 Also see this question for reference.
另请参阅此问题以供参考。
Of course, if you have a physical iPhone 4, you can also test on the actual device. 当然,如果您有实体iPhone 4,也可以在实际设备上进行测试。 Make sure that your
Deployment Target
under TARGETS
AND the iOS Deployment Target
under PROJECT
are set to 7.1
or below. 请确保您的
Deployment Target
下TARGETS
和iOS Deployment Target
下的PROJECT
设置为7.1
或以下。 Your Base SDK
can be set higher, but this means you will have to make sure that you are either not using features or classes that are unavailable in earlier versions of iOS, or do a version check and adapt your program accordingly. 您可以将
Base SDK
设置得更高一些,但这意味着您必须确保没有使用iOS早期版本中不可用的功能或类,或者进行版本检查并相应地调整程序。 For example, UIAlertController
was introduced in iOS 8, and will crash a device below that if it is invoked. 例如,iOS 8中引入了
UIAlertController
,如果调用该设备,它将使低于该设备的设备崩溃。 So you might want to do a version check and use good old UIAlertView
if the iOS device version is below 8. An issue like this is the most probable cause of your crash. 因此,如果iOS设备版本低于8,则可能需要进行版本检查并使用良好的旧
UIAlertView
。此类问题是导致崩溃的最可能原因。
Also, if it's the first time you're using this device for development, don't forget to set it up by going to Window -> Devices
, selecting your connected device, and pressing Use for development
. 另外,如果这是您第一次使用此设备进行开发,请不要忘记通过以下方法进行设置:进入“
Window -> Devices
,选择连接的设备,然后按“ Use for development
。
If you don't have the iOS 7.1 SDK and don't see it as a iPhone 4S (7.1)
in the simulator selection, you need to download it by going to Preferences -> Downloads
. 如果您没有iOS 7.1 SDK,并且在模拟器选择中没有将其视为
iPhone 4S (7.1)
,则需要转到Preferences -> Downloads
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.