Friday, February 20, 2015
2
At the start of this month, Apple told developers that all future submissions to the App Store (new apps and updates) have to be x64 compatible. I went ahead and migrated Puzzle Dungeon for iPhone over to 64-bit and found a few hurdles along the way to overcome. For existing projects, using the Cocos2D-Swift / Cocos2D-iPhone cross platform engine, there doesn't appear to be an easy fix.

I decided that I'd write an easy 10 step guide to migrating an existing Cocos2D 2.0 app to a 64-bit architecture.

0. Back up your project. This should go without saying.

1. In Xcode, select your project in the Project Navigator, then select Build Settings from the top menu.

2. Click on the Architecture setting and select "Standard Architectures (armv7, arm64) - $ (ARCHS_STANDARD)" from the list


3. Your project will no longer build due to errors in CCDirectoriOS.h. Don't worry, the version of Cocos2D you have doesn't work with 64 bit architecture. Go to This website and download version 2.2 (3.0 will break compatibility with your app, so we don't want that one.)

4. Once downloaded, unzip the archive and find the following 3 folders: "cocos2d", "CocosDenshion" and "Kazmath". Copy these to your project folder, replacing the existing folders.


5. If Xcode has trouble recognising the new files, remove the references by right-clicking on the folder in Project Navigator, and reimporting them.

6. More build errors. This is still normal. CCLabelTTF is looking for the CoreText.framework but can't find it. In Xcode, select your project in the Project Navigator, then select Build Phases from the top menu.


7. Select "Link Binary With Libraries" and add CoreText.framework.

8. One last build error. "Unknown register name 'q0' in asm". In Project Navigator, select search and type "ARM_NEON". There will be 2 results. 

9. Change both instances of "__ARM_NEON__" to "__ARM_NEON_NOT_USED__".

10. Now build your app, and it will be running on 64-bit architecture. 

2 comments:

Post a Comment