10

This morning I got an e-mail from Apple saying the following:

Dear Developer,

As we announced in October, beginning February 1, 2015 new iOS apps submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK. Beginning June 1, 2015 app updates will also need to follow the same requirements. To enable 64-bit in your project, we recommend using the default Xcode build setting of “Standard architectures” to build a single binary with both 32-bit and 64-bit code.

If you have any questions, visit the Apple Developer Forums.

Best regards, Apple Developer Technical Support

Now I have a question, how do you ensure that an iOS app IS 64bit compatible?

My build settings look like this: Architectures

My Deployment target is iOS 6.0.

I just need to confirm that the app is 64 bit compliant, I am all new to iOS and took over a fairly large project not long ago so I'd rather ask and be 100% sure.

Just to make things a bit clearer, how do you ensure that an iOS app is 64bit compatible? I know you need to set certain build rules such as the one in the image, but I want to know is there any way of knowing that your iOS app is 64 bit compliant. 32 bit iOS apps can run on 64bit hardware so I don't believe checking if the iOS app runs on a device will help.

I believe you could upload a new version and see if you get this message: But I was hoping for a nice option without uploading a new build. image

Thanks!

apmartin1991
  • 3,064
  • 1
  • 23
  • 44
  • I'm not sure I understand the question. Can't you just test it on a 64-bit device to ensure it works? – Droppy Dec 18 '14 at 10:02
  • 1
    how do you ensure that an iOS app is 64bit compatible? I know you need to set certain build rules such as the one in the image, but I want to know is there any way of knowing that your iOS app is 64 bit compliant. – apmartin1991 Dec 18 '14 at 10:06
  • Ultimately you test it. If you want to know if it's successfully building the 64-bit architecture then look at your build logs. – Droppy Dec 18 '14 at 10:08
  • 2
    It is building just fine, with no errors, it runs on all iPhones running iOS 6/7/8/8.1 But I just need to be 100% sure that it is 64 bit compliant. Just seeing if it compiles and works on phones isn't enough, because 32bit apps would work on a 64bit phone. – apmartin1991 Dec 18 '14 at 10:10
  • So change the architecture, temporarily, to just arm64 and test that. What's the difficulty here? – Droppy Dec 18 '14 at 10:11
  • That's a good idea, The difficulty is I am not an iOS programmer, I don't know how to use XCode that well, and I am not 100% on Objective-C like I am at programming Andorid. I would much rather ask a question, get an answer so I can give my client a good answer with good reasoning, than give my client which is at most, a good educated guess. – apmartin1991 Dec 18 '14 at 10:13
  • 1
    Go to app archive or unpack your ipa, find binary and run `file binary`, you will see all archs inside. – pronebird Dec 18 '14 at 10:25
  • 1
    Bear in mind that compiling for 64-bit is just the first step in 64-bit compatibility. You need to make sure you can read/write files or data between the 32-bit and 64-bit versions of your app. Apple have provided guides to assist you. See https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Cocoa64BitGuide/Introduction/Introduction.html and https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html – Robotic Cat Dec 18 '14 at 10:59
  • If you're just releasing an update you have till June 1st for supporting 64 bit – ManicMonkOnMac Feb 11 '15 at 23:36

1 Answers1

10

With the settings you have you should end up with arm64 and armv7 in your binary. You won't get armv7s because although it's a valid architecture, it's not included in ARCHS_STANDARD if building on Xcode 6 (See also).

Just because it runs on a 64 bit device, it doesn't mean that it has 64-bit support. 64-bit devices can run 32-bit apps.

To determine whether or not it contains an arm64 chunk, you need to find the application. Go to Xcode preferences, and select the Locations tag. The Derived Data line tells you where files are being built.

XCode settings : Locations

Open up a Terminal (Finder->Applications->Utilities->Terminal) and go to that location using the 'cd' command. In my case, my project is stored in ~/MyProject

$ cd ~/MyProject
$ cd build
$ find . -name MyTarget
./build/MyTarget
./build/MyTarget/Build/Products/Debug-iphoneos/MyTarget.app/CoreControl
./build/MyTarget/Build/Products/Debug-iphoneos/MyTarget.app.dSYM/Contents/Resources/DWARF/CoreControl

Now we know where the binary is stored (it's the second result), we can check it to see what architectures it contains:

$ dwarfdump ./build/MyTarget/Build/Products/Debug-iphoneos/MyTarget.app/MyTarget
----------------------------------------------------------------------
 File: ./build/MyTarget/Build/Products/Debug-iphoneos/MyTarget.app/MyTarget (armv7)
----------------------------------------------------------------------
.debug_info contents:
< EMPTY >

In my case, I only have arm7 built, not arm64.

Community
  • 1
  • 1
Airsource Ltd
  • 32,379
  • 13
  • 71
  • 75
  • Or look at the build log and observe the building and linking or the `arm64` architecture? – Droppy Dec 18 '14 at 10:42
  • Thanks! I will try this out now and I will let you know the result, very clear, well constructed answer there with more than enough information for a newbie to follow. Thanks (y) – apmartin1991 Dec 18 '14 at 10:53
  • @Droppy that will also work, although strictly speaking that verifies that arm64 was built when compiling, not that the final output of the entire build process still contains it. – Airsource Ltd Dec 18 '14 at 10:53
  • @apmartin1991 - be aware that just because you have compiled your project in 64-bit mode, doesn't mean that it will run properly. Most projects require the odd mixup when built for 64 bit, because old code often makes assumptions that, for example, an NSInteger is 32 bits. – Airsource Ltd Dec 18 '14 at 10:55
  • AirSource - Thanks for that, I will be testing the app from scratch once I am sure that is is in 64bit :) – apmartin1991 Dec 18 '14 at 11:06
  • Very sorry for the delay in getting back, this was a damn good answer, which was well explained and well documented. Marked as correct. thanks for this very good answer :) – apmartin1991 Jan 07 '15 at 10:44
  • ./Products/Debug-iphonesimulator/MyApp.app.dSYM/Contents/Resources/DWARF/MyApp (x86_64) so my app is compatible for 64 bit ?? and what about the log – yoshiiiiiiii Jan 22 '15 at 05:29