Delphi 10.1 berlin multiple ios SDKs - delphi

I have latest delphi and xcode etc running iphone sdk 10.2. Is there a way to setup a new platform and build to say ios 9? My list of sdks only shows 10.2. Not sure about supporting olders phones etc

You do not need to install earlier versions of SDK. The application compiled with Delphi Berlin will work at all versions of iOS, as stated in Options/Delphi Compiler/Linking/Minimum iOS version supported.
FMX library will work with iOS API 8..10 (there are some checks for version in source code - look for "TOSVersion.Check"). So as long as you will not use any extra iOS API "by hand", it will work for all devices running iOS 8..10. It is also possible, that basic applications will work for earlier versions, but it is of course unsupported.
For iOS 10 remember about extra security-related settings: http://docwiki.embarcadero.com/PlatformStatus/en/Main_Page
Summary: you do not need separate SDK nor extra version of the app for different iOS versions.
Remark about iOS development: in fact, xcode 8 also limits the target to iOS>=8, while you can setup it regardless of SDK in the project options in range 8..10. It is possible to force xcode 8 to compile and link against iOS 7 devices, but it is very hard to test and deploy, thus useless.

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.

Do I need to build my project with the latest available version of Xcode available on the Mac App Store for submission or can I use the older version

I was going through app review guidelines and one thing which I am unable to find the answers is
"Do I need to build my project with the latest available version of Xcode available on the Mac App Store or can I use the older version "
For example the current version of Xcode available on Mac App Store as of writing of these lines is Xcode 9.0, so do I need to build my project using Swift 4 and Xcode 9.0 or can I use older versions (say Swift 3.x and Xcode 8 or Xcode 7).
A similar question was asked in Feb 2012
Do I need the latest version of Xcode to submit apps to the app store?.
But it doesn't provide clear cut answer and the answer is more than 5 years old. And during that time the language for choice was objective -C whose versions were and are more stable than current lingua franca, Swift.
You can use older version of Xcodes (Xcode 8.x) to develop and upload
your project build on app store. There is no any such kind of
restriction by Apple, that you must use latest Xcode Tool to upload a
build on the store
I recommend and a as good advise,
You should use latest version of Xcode Tool to make your app, compatible with latest version of technology. You should see and implement, changes in technology. And one most important and major update in Xcode 9 is - support for iPhone-X device. To see your app interface is compatible with iPhone-X or not, you must use Xcode 9. There are so many other considerable updates in Xcode 9 (with iOS 11)
Here is list of updates with Xcode 9: Highlights of Xcode 9
It's not required to convert/change version of Swift programming language to provide a support of latest Tool.
Xcode 8.3 & Xcode 9, both supports Swift 3.2 version. So, if your current project is supporting, Swift 3.2 version, then you can easily work with Xcode 9.0
How to see current Swift version of your Xcode Project
Also, review this answer to see, how you can make your project compatible to Xcode 9 - Xcode 9 Swift Language Version (SWIFT_VERSION)
Here is nice answer from Apple:
Why You Should Use the Latest SDK
Building with the latest SDK gives your app all possible bug fixes and new behavior. For compatibility reasons, frameworks can't always expose improved behavior, unless apps are built with the latest SDK.
For example, when Retina enabled iPads were first introduced, only iPad apps built with the very latest iOS SDK could create Retina images by simply loading an image with an #2x suffix.
By building with the latest SDK, apps signal that they are ready for all API improvements and bug fixes.

XCode base SDK version in code

How can I get the version of the base SDK in code? I am currently building for iOS in XCode 6 and using the base SDK 8.1 . I would like to know if there is any define with the value of the SDK to be able to test it and allow building with different base SDKs.
You can find out the version of the current Foundation framework that the code is running against by checking the value of NSFoundationVersionNumber.
If you check out the NSObjCRuntime.h you will find the various version numbers listed in there.
As in regards to building against different versions of the SDK; Apple stops App Store uploads if you don't build against the latest SDK once the cut off date has come into effect - i.e. new apps submitted now must be build against iOS 8 SDK.
What you can however do, is have a lower iOS Deployment Target (this you can find in your project's settings). This will allow for your app to run on older iOS versions, but it will still be built against the latest SDK. Do note though, it is your responsibility to ensure that you do not use any new APIs without first ensuring the current environment supports them e.g. UITextField's selectable property.
If you call that whilst running on iOS 6, your app will crash.
This can be done using __IPHONE_OS_VERSION_MAX_ALLOWED (which is the same version as the base SDK version). That can be compared to __IPHONE_8_0 where 8_0 is the iOS release.
For example, at this point you can use the baseSDK 8.0 or 8.1.

iOS 6 APIs and backwards compatibility

Can I use APIs and Frameworks introduced in iOS 6 in an app that supports earlier iOS versions?
Is this only possible through workarounds and code such as:
[[UIDevice currentDevice] systemVersion]
Or would I be able to use updated frameworks, APIs, etc. in an app that supports earlier versions of iOS without specifying the version?
And also, would I be able to use Xcode 4.5, or would I have to stick to the current public release?
You can't ship an app that uses iOS 6 features at all until the OS and toolchain go final. (Update: The iOS 6 OS and SDK are now final.)
At that point, you should use the iOS 6 SDK and set your deployment target to an earlier version of iOS 5. You will not check the system version, but rather weak link the new frameworks, and test for the presence of specific classes or methods before using them, etc.
One extra wrinkle is that with the iOS 6 tools and SDK you can no longer support armv6 devices. You can support the iPhone 3GS and later, as well as every model of the iPad, but not the iPhone 3G and the original iPhone. But even with a legacy app, you shouldn't be targeting these anymore.
References:
SDK Compatibility Guide: "Read this document if you want your application to target a specific version or multiple versions of iOS or Mac OS X."

Confused about iOS 5 SDK Capabilities vs iOS 5 Capabilities of the Device

I am unclear on how to tell if a new feature of iOS 5 requires iOS version 5 running on the device or if the feature can be obtained simply by compiling with the iOS 5 SDK.
ARC is an example. I understand if it supported under the iOS 5 SDK on devices that have not upgraded to iOS 5. Where is the documentation that tells me what SDK features require iOS 5 on the device?
You should always use the newest SDK as base SDK in your application. You can always target older iOS version with the "Deployment Target" setting, but you have to pay attention which new features you can use.
For example, iOS 5 brings two interesting new features, namely ARC and storyboards. You can use ARC if your deployment target is iOS >= 4.0, with the exception of weak references, which unfortunately do not work with iOS4. Storyboards are different, they need iOS 5, they won't work at all on older devices!
If you're using the newest XCode 4, you have to do some extra work to fully support iOS 4 or older versions. This is because the armv6 code generation has been deleted from all templates. Newer devices use the armv7 instruction set, but you can compile your application so that it targets both the armv6 and armv7 instruction set. See my other post on this topic.
Generally you can build application using iOS SDK 5, which will be working on older iOS.
The build settings of every project have two different parameters, which define base SDK and iOS Deployment Target.
This first defines which SDK do you use to build your app. Second is the minimum iOS version which is required for your application.
When you build this application, you should pay attention to not use any function / object which are newer then your deployment target, because compilator and linker can allow to use it, and application will crash on devices.
Of course Apple Docs always contains information about minimum iOS version, which is required by an object. Every new version always contains change log, containing changes from previous version.
Examples:
Description of iOS 5 SDK
iOS 5 Release Notes

Resources