Compiling legacy code using iOS 7 SDK breaks app - ios

I have a developed application and the code is compiled using Xcode 4.6 and executes on iPhone with IOS version 6.1.3 . That's all OK.
Now I am requested to test it on the iOs 7.0 or later version . Then I upgrade all needed stuff , including xcode, mac OS version ,etc. (I have to upgrade them because the original version of xcode complains of the failure that it can not compile and debug on ios7.0)....
When I try to build the code using the latest combined versions and run on ios7.0, the application is dysfunctional and the problems are mainly related to GUI-related.
But the application with xcode 4.6 built can normally run on IOS 7.0.3 phone. So I think it is feasible for the legacy code/SDK to run on ios 7.0.3. Currently, I don't have plan to upgrade the code to optimize for ios7.
So My question is : How can I test/debug this application on iOS 7 or later ?
Thanks alot
Daniel

If i am not getting wrong understanding from your question...And what you want is this..
You don't want to build your application using iOS 7 base sdk (You were using iOS 6 base sdk on xcode 4.6).
But you want to use latest xcode with old SDK 6.1 etc and test apps on iOS 7 Devices/Simulators
Here is solution...
You just need to copy 6.1 SDK(or older) from your old xCode(4.6) to latest xcode(5.x) sdk folder and set base sdk to 6.1 SDK(or older one) in project setting.
This will let you run your app on devices with iOS 6.x or lower as they were running before also lets you test your app on iOS 7 devices without compiling with latest iOS 7 SDK.
To achieve this..
1. click on your xcode4.6 -> show package content , go to path
/Applications/Xcode_4.6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer
This is where you will see older SDK you were using (6.1 etc). Now open same path for latest xcode 5.x and copy SDKs from old xCode path to new xCode path. OR Download it from Xcode preference -> Downloads.
2. Now go to project setting and set base sdk as iOS 6.x SDK

You can use Wireless AdHoc Distribution or simply build the IPA and install it through iTunes. Debugging it, however, is a bit more complicated. You will have to launch Instruments on its own and choose the already running process on the device.

Related

How can Delphi be used to develop iOS apps if the iOS devices are running the latest iOS version?

The idea of using Delphi to develop a mobile app is appealing to us because we can do Android, iOS and Windows without duplicating work. Delphi is also a language that we are familiar with. However after trying to get a simple test app running on an iPad, I do not think it is actually realistic. Here are my observations:
The iPad is running iOS 12.0.1 (and iOS 12.1 is already downloaded and ready to install).
Xcode, which runs on the mac, is used by Delphi for building apps and deploying them to the test target. Each Xcode version supports exactly one iOS SDK version and is the Xcode version plus 2. My old Mac is currently running xcode 8.2.1 so that corresponds to iOS SDK 10.2, which should run on iOS 10.2 and higher.
Delphi Tokyo supports iOS SDK versions from 8.0 up to 11.3 (so Xcode 6 to 9). It will not compile apps using SDK 12. The Xcode version running on the mac fits squarely within this range of versions.
It appears that Xcode is not able to properly support iOS versions that are newer than itself. When trying to run the application it errors out with "unable to location DeviceSupport directory for the connected device. Please check Xcode installation path and run Xcode devices". Under "Devices" the following is displayed for the iPad: "This iPad mini2 is running iOS 12.0.1, which may not be supported by this version of Xcode".
So, it would appear that the latest Xcode version is required to support the iPad running iOS 12.x but that means that Delphi cannot compile for it because it only goes up to SDK 11.3 and not 12. I do not think it is possible or sensible to downgrade the iPad iOS. Also even if we get a Delphi version that works, the next iOS update will require a new Xcode and therefore a new Delphi version that isn't even available. When the new Delphi version is finally available it will already be obsolete since iOS will have already moved on.
Please correct me where I am wrong. Because this cannot surely be the state of things.

Swift Code in XCode 7.3.1 not working in iOS 10

I am building an iOS app using Swift 2.2, XCode 7.3.1, which is going to go live very soon. I upgraded my iPhone to iOS 10.0 and now when I try to run my code in my iPhone, I am getting the error -
At this stage of my project I don't want to upgrade to XCode 8.0 and use Swift 3.0. Is there any way I can make my code written in XCode 7.3.1 work in iOS 10. My code is working well for iPhones having iOS versions 9.3.2
Thanks
No, Xcode 7.3.1 does not support iOS 10. You cannot. You will have to upgrade to Xcode 8.
And, you should upgrade because it also provides you Swift 2.3 which will help you run latest SDK for iOS 10 etc and the transformation is automatic.
Read here: https://developer.apple.com/swift/blog/
To detect device in XCode you must install software with appropriate version or system will show you the message you have mentioned in the question.
A workaround as per your wish is that every time you make an IPA of your release and install it in the device you want to run with it (that could be a hard time if you deploy several times a day). Remember there is an upward compatibility but no downward compatibility that is if your deployment target is 8 or above you can run the IPA on device having iOS 8 or above but not in iOS 7.
Perhaps you may get some issues on running it on new iOS because of the some obsolete or new features, and to fix that you must upgrade XCode and compile your code on it.
Hope that helps!
Copy the folder 10.0 (14A345) in DeviceSupport folder of Xcode8 to
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
It works for me :)

Using IOS 7.0 Simulator on Xcode 7.2.1

I would like to make my app compatible with IOS 7.0 but in the preferences --> downloads section, the lowest available version is IOS 8.1 simulator. I'm currently using OSX Yoesmite 10.10.5 wih xcode 7.2.1 running version 9.2.
Does that mean there's no way to test for app compatibility for any versions lower than IOS 8.1?
Edit: I realize it's possible to install older versions of xcode. I want to know if it's possible to download only the simulators on my current xcode, not have an entirely new and different xcode.
The answer should be NO.
It's not just about the simulator, but the SDK you use to compile the app to run within the simulator. When you use newer SDK to compile, the binary could contain unknown load commands to the binary header, or unknown APIs calls to an older system. That's the main reason you can't run an app built with newer SDK/system on an older OS. Even if it worked, it might still crashed at some point when the needed symbols can't be resolved.
So in order to run/build app for an older version of simulator, you need:
An older version of Xcode (which has older version of SDK)
Or, find out a way to setup your current version of Xcode to compile
with the older SDK extracted from an older version of Xcode. (This
may and may not work due to the change made to Xcode.)
For the second option, you can google it for how-to.

How to Add iOS 6.0 Simulator in Xcode 5?

i want to add iOS 6.0 Simulator in Xcode 5 for that i add SDK in my Xcode 5 Content Folder From Xcode 4.5 like as
Xcode 4.5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDK/iPhoneOS6.0SDKs/
And Copy this SDK Folder in Xcode 5 Folder as
Xcode5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDK/iPhoneOSSDKs
folder but it is not Display iOS 6.0 In my Xcode 5 Simulator.
Here i not want to Download so please Give me Solution With out
Download Option.
Go to Xcode->Preferences->Downloads
From there you can download iOS 6 simulator.
Copying SDK is just gives a support to that simulator but to view iOS 6.0 simulator in a list (simulator interface), You must have to download it.
Of course it will work for the older OS SDKs, I mean copying older SDKs from older Xcode to newer Xcode SDKs will give you support to create build for older iOS version and it will also supports older OS version APIs, but it will not work for Simulator as you expected.
Try to understand that to copy sdks from Xcode 4.5 will not work for new APIs. This can not be the way you are trying to do.
You must have to follow the regular download way!!
Click on Xcode preferences >> Go to Downloads section
Download simulator from Components section.

How to build and test Xcode iOS SDK 4.3 project in iPad 2 iOS 5?

I'm wondering if I can build and test my current project which is iOS SDK 4.3 based, to iPad 2 (iOS 5)? In Organizer - Devices it says:
The version of iOS on “my iPad” does not match any of the versions of iOS
supported for development with this installation of the iOS SDK. Please restore
the device to a version of the OS listed below, or update to the latest version
of the iOS SDK;
Can I build my project without updating to iOS SDK 5?
No, this isnt possible, you must upgrade to the lastest Xcode.
It is possible to have two versions of Xcode installed if you still want to hang onto the old one.
What is the reluctance to upgrade? Are you having compiling issues?

Resources