Build Success : Step By Step (Updated)
by Sven Bergström · in iTorque 2D · 10/22/2009 (10:18 am) · 29 replies
So , i downloaded T2D_iPhone_Beta_1_0 and wanted to see how easily i can get it to build. I decided to make a step by step approach of the steps i have taken, in order to achieve a working build - both on device and in the simulator.
Building For iPhoneOS 2.0, 2.1, 2.2.1, 2.x: ONLY SUPPORTS GCC 4.0! NOT 4.2
Building for iPhoneOS 3.x + : Supports Gcc 4.2, excludes all 2.x users from your game.
First up (section A) - System Specs :
Platform : 2007 iMac
OSX Version : 10.5.7
XCode Version : 3.1.4
iPhone SDK : 3.1.2 sdk for leopard
iTGB Version : T2D_iPhone_Beta_1_0 (aka iTGB 1.3 beta)
Devices tested on : iPod Touch 1st Gen/2x iPod Touch 2nd Gen / Simulator ( 2.2.1, 3.0, 3.1, 3.1.2 )
Second - Build Configuration :
Open Torque2D.xcodeproj :

Check that the settings are what i am hoping for :

Check the compiler version :

Check the SDK im using :

The results (the image shows the iTGB Optimized one, i tested both targets the same way) :
Testing on Device :
I got 1 error on build for device :

So i go and rectify this by setting my proper provisioning profiles accordingly :
I first set the app identifier inside the properties (info.plist file) of the target :

I then set the properties of the code signing authority on the Build tab :

I will test snow leopard soon, and report back with the same workflow.
For those who have succeeded
If you have had SUCCESS building and using iTGB, please post "section A" above, with your system specs.
Note : Has anyone on Snow leopard succeeded so far?
For those who have not
if you have NOT had success building the games, please also post "section A" with your own system specs, and if you have not - try the above (it might seem obvious but settings in xcode get applied the minute you change them). And, if possible make sure you have the latest versions of the software for iphone development (though, still never had problems with previous versions of the SDK's, the tools are YARDS better in 3.1.2).
Goals
Please do not spam this thread with negativity and useless complaints. Do that in another thread and lets keep this one for good reference :) iPhone development is a challenge on many aspects, and the tools are only starting to get better recently (XCode, and aspects of using the SDK were horrific at first). The goal is to pinpoint the problems in a sea of possible errors that have to do with the environment you are building on, the setup you have created and the tools you use. If we can make a nice list of "watch out for's" we will be a lot better of in the very near future.
With my current setup i have had no issues working with iTGB overall (excluding the issues with code bugs etc), and if we can find where the problems are creeping in the problems can be eliminated by being documented thoroughly and extensively.
Update : SDK 3.0 / GCC 4.2 build info!
The following information had been made known to me thanks to Tim from maxgaming.Building For iPhoneOS 2.0, 2.1, 2.2.1, 2.x: ONLY SUPPORTS GCC 4.0! NOT 4.2
Building for iPhoneOS 3.x + : Supports Gcc 4.2, excludes all 2.x users from your game.
First up (section A) - System Specs :
Platform : 2007 iMac
OSX Version : 10.5.7
XCode Version : 3.1.4
iPhone SDK : 3.1.2 sdk for leopard
iTGB Version : T2D_iPhone_Beta_1_0 (aka iTGB 1.3 beta)
Devices tested on : iPod Touch 1st Gen/2x iPod Touch 2nd Gen / Simulator ( 2.2.1, 3.0, 3.1, 3.1.2 )
Second - Build Configuration :
Open Torque2D.xcodeproj :

Check that the settings are what i am hoping for :

Check the compiler version :

Check the SDK im using :

The results (the image shows the iTGB Optimized one, i tested both targets the same way) :
Testing on Device :
I got 1 error on build for device :

So i go and rectify this by setting my proper provisioning profiles accordingly :
I first set the app identifier inside the properties (info.plist file) of the target :

I then set the properties of the code signing authority on the Build tab :

I will test snow leopard soon, and report back with the same workflow.
The purpose of this thread :
For those who have succeeded
If you have had SUCCESS building and using iTGB, please post "section A" above, with your system specs.
Note : Has anyone on Snow leopard succeeded so far?
For those who have not
if you have NOT had success building the games, please also post "section A" with your own system specs, and if you have not - try the above (it might seem obvious but settings in xcode get applied the minute you change them). And, if possible make sure you have the latest versions of the software for iphone development (though, still never had problems with previous versions of the SDK's, the tools are YARDS better in 3.1.2).
Goals
Please do not spam this thread with negativity and useless complaints. Do that in another thread and lets keep this one for good reference :) iPhone development is a challenge on many aspects, and the tools are only starting to get better recently (XCode, and aspects of using the SDK were horrific at first). The goal is to pinpoint the problems in a sea of possible errors that have to do with the environment you are building on, the setup you have created and the tools you use. If we can make a nice list of "watch out for's" we will be a lot better of in the very near future.
With my current setup i have had no issues working with iTGB overall (excluding the issues with code bugs etc), and if we can find where the problems are creeping in the problems can be eliminated by being documented thoroughly and extensively.
#2
Not on my machine so I can't give the exact versions etc, but its a MBP with latest XCode etc. (Will edit this post with an update when I'm actually with my Mac)
10/22/2009 (1:56 pm)
I'm on Snow Leopard, with no problems building and running.Not on my machine so I can't give the exact versions etc, but its a MBP with latest XCode etc. (Will edit this post with an update when I'm actually with my Mac)
#3
Using SDK 3.x (which you must use nowadays), deployment target 2.x (depending on mood), GCC 4.2. Integrated with custom code, removed some other code, and plugged in OpenFeint.
10/22/2009 (6:53 pm)
Latest Snow Leopard+SDK (for 3.1.2), no problems. Late 2008 unibody MacBook.Using SDK 3.x (which you must use nowadays), deployment target 2.x (depending on mood), GCC 4.2. Integrated with custom code, removed some other code, and plugged in OpenFeint.
#4
10/23/2009 (10:57 am)
I could not see the screenshot.
#5
OSX Version : 10.5.7
XCode Version : 3.1.3
iPhone SDK : 3.0.0 sdk for leopard
iTGB Version : T2D_iPhone_Beta_1_0 (aka iTGB 1.3 beta)
Devices tested on : iPod Touch 2nd Gen / iPhone 3G
Everything works great. However (as expected) GCC4.2 crash the game immediately if using device 2.2.1
10/23/2009 (12:35 pm)
platform : 2008 iMacOSX Version : 10.5.7
XCode Version : 3.1.3
iPhone SDK : 3.0.0 sdk for leopard
iTGB Version : T2D_iPhone_Beta_1_0 (aka iTGB 1.3 beta)
Devices tested on : iPod Touch 2nd Gen / iPhone 3G
Everything works great. However (as expected) GCC4.2 crash the game immediately if using device 2.2.1
#6
10/25/2009 (9:43 pm)
Build Success is not the end ,I want to know the fps value in your device .
#7
http://www.suddengames.com/astro-bugz.html
The whole game is torque script.
10/25/2009 (10:16 pm)
my game astro bugz is running on 28fps. you can check the movie here.http://www.suddengames.com/astro-bugz.html
The whole game is torque script.
#8
10/26/2009 (1:48 am)
Our game gets 50+ FPS on second gen iPod touch.
#9
It sounds good, I suggest Torgue buy your app src and use it as sample code for their product.
10/27/2009 (11:09 am)
>Our game gets 50+ FPS on second gen iPod touch.It sounds good, I suggest Torgue buy your app src and use it as sample code for their product.
#10
I was wondering why the TGB_Optimized gets an error.
Other than that I am pretty impressed, the speed and such is better than I expected from what I have read in the forums.
10/29/2009 (7:11 pm)
I just bought this yesterday and it worked, I have Snow Leopard and just downloaded the latest SDK. Since the older one I had would not work with my totally updated phone.I was wondering why the TGB_Optimized gets an error.
Other than that I am pretty impressed, the speed and such is better than I expected from what I have read in the forums.
#11
Do you mean, before yesterdays success? Or is there an error with the optimised target currently in your build chain?
Glad to hear it went well otherwise.
10/30/2009 (4:20 am)
Quote:I was wondering why the TGB_Optimized gets an error.
Do you mean, before yesterdays success? Or is there an error with the optimised target currently in your build chain?
Glad to hear it went well otherwise.
#12
Platform : Mac Mini
OSX Version : 10,6.2
XCode Version : 3.2,1 64-bit (note that Apple states 3.2 is for Snow Leopard and 3.1.4 is Leopard only*)
iPhone SDK : 3.1.2 sdk for leopard
iTGB Version : T2D_iPhone_Beta_1_0 (aka iTGB 1.3 beta)
Device: iPhone 3GS
File used - iPhoneTest sample.
DEBUG MODE RESULT: BUILDS, DEPLOYS, HANGS.
DETAILS: Built with same number of warnings as you, moved to the iPhone, started, saw the splash screen, blew out on launch time.
Exception Type 00000020
elapsed total CPU time 20.030 seconds
I can see the stack trace but I'm not used to the underlying code base - it reached the start +44 but it appears that other threads were still waiting on unresolved mutexes.
I will continue to update this post as status improves with a 'symptom - fix' approach until it works, to leave a useful set of notes for others to be successful.
RELEASE MODE RESULT: BUILDS, DEPLOYS, HANGS.
Built and deployed iPhoneTest in release mode - note you must specify dynamic linking (see other thread). App builds and deploys, launches then hangs on splash screen (same as with DEBUG).
---
HYPOTHESIS: issues encountered with hangs are due to the 3.0 behaviour. Trying to build for 2.2.1 SDK (re: http://iphonedevelopertips.com/xcode/build-iphone-apps-for-2-2-and-earlier-using-xcode-3-2-and-snow-leopard.html)
11/28/2009 (1:24 pm)
Since you have asked about Snow Leopard, I tested this with Platform : Mac Mini
OSX Version : 10,6.2
XCode Version : 3.2,1 64-bit (note that Apple states 3.2 is for Snow Leopard and 3.1.4 is Leopard only*)
iPhone SDK : 3.1.2 sdk for leopard
iTGB Version : T2D_iPhone_Beta_1_0 (aka iTGB 1.3 beta)
Device: iPhone 3GS
File used - iPhoneTest sample.
DEBUG MODE RESULT: BUILDS, DEPLOYS, HANGS.
DETAILS: Built with same number of warnings as you, moved to the iPhone, started, saw the splash screen, blew out on launch time.
Exception Type 00000020
elapsed total CPU time 20.030 seconds
I can see the stack trace but I'm not used to the underlying code base - it reached the start +44 but it appears that other threads were still waiting on unresolved mutexes.
I will continue to update this post as status improves with a 'symptom - fix' approach until it works, to leave a useful set of notes for others to be successful.
RELEASE MODE RESULT: BUILDS, DEPLOYS, HANGS.
Built and deployed iPhoneTest in release mode - note you must specify dynamic linking (see other thread). App builds and deploys, launches then hangs on splash screen (same as with DEBUG).
---
HYPOTHESIS: issues encountered with hangs are due to the 3.0 behaviour. Trying to build for 2.2.1 SDK (re: http://iphonedevelopertips.com/xcode/build-iphone-apps-for-2-2-and-earlier-using-xcode-3-2-and-snow-leopard.html)
#13
1) Why do I get so many warnings/errors with the sample code (BehaviorShooter_Components) when targeting a simulator? 8,000+?
2) But when I target a device I only get two (provisioning and no architecture to compile for)?
3) How do I run the program anyway even with thousands of warnings/errors? It seems like that is something I've been reading about on these boards.
Platform: MacBook Pro
OSX version: 10.6.2
Xcode: 3.2 (64 bit)
iTGB: uTGB 1.3 beta
Simulator: 3.0, 3.1
Device: 3.0, 3.1
P.S. I have succesfully built and provisioned apps I built in Xcode from scratch.
11/28/2009 (5:13 pm)
Some very beginner level questions:1) Why do I get so many warnings/errors with the sample code (BehaviorShooter_Components) when targeting a simulator? 8,000+?
2) But when I target a device I only get two (provisioning and no architecture to compile for)?
3) How do I run the program anyway even with thousands of warnings/errors? It seems like that is something I've been reading about on these boards.
Platform: MacBook Pro
OSX version: 10.6.2
Xcode: 3.2 (64 bit)
iTGB: uTGB 1.3 beta
Simulator: 3.0, 3.1
Device: 3.0, 3.1
P.S. I have succesfully built and provisioned apps I built in Xcode from scratch.
#14
See alanquatermain.net/post/124150829/iphone-2-x-sdks-on-snow-leopard - I have not (yet) read this but hope it is of use to you.
11/29/2009 (5:15 pm)
Django Zeaman - Jim Dovery on openradar.appspot.com/6973133 says "1. regardless of the deployment target, building for the Simulator will ALWAYS use iPhone SDK 3.0 APIs, thus generate deprecation warnings aplenty. Building for the Device will not give those warnings."See alanquatermain.net/post/124150829/iphone-2-x-sdks-on-snow-leopard - I have not (yet) read this but hope it is of use to you.
#15
Warnings are the result of code that is compiled between 2 very different compilers (windows/msvc vs gcc) and gcc being very "strict" compared. The warnings are often variables that are not really used, catches of unused variables etc. These do not really affect the program in any way, only the compilation phase.
11/30/2009 (3:00 am)
Also, its more that 2) is because your application is not READY to be built - so it is not building anything. Once the provisioning has been set to a valid architecture - you have to change the Project -> Active SDK -> Menu item to point to DEVICE - not simulator. once the settings are correct it will compile and you should get some warnings and stuff as well.Warnings are the result of code that is compiled between 2 very different compilers (windows/msvc vs gcc) and gcc being very "strict" compared. The warnings are often variables that are not really used, catches of unused variables etc. These do not really affect the program in any way, only the compilation phase.
#16
Still wondering about 3) So how do I get it to build despite these warnings?
11/30/2009 (4:56 am)
Thanks for the help. Still wondering about 3) So how do I get it to build despite these warnings?
#17
11/30/2009 (5:25 am)
Well, you fix the errors. ;) warnings do not get in the way of the build working. The errors , they are stacked so you only need to fix the first error in the list at a time, which will often result in much less the next build.
#18
Here is what I think you are missing:
In Xcode, scroll down in the left menu to "Targets", right click "iTGB", click "Get Info". Ensure "Architectures" is set to Standard (armv6), "Base SDK" has iPhone Device 3.0. Scroll down to "Code Signing" set "Any iPhone OS Device" to iPhone Developer (when you open this ensure you see your certificate - if you don't you did not register it with Apple and your Xcode/keychain on your Mac right - see here: mobiforge.com/developing/story/deploying-iphone-apps-real-devices)
11/30/2009 (10:33 am)
Django - you're running nearly the same environment as I am - the two that you are showing are to do with unspecified project settings. I can build though I have an issue with running on the iPhone I am following up on.Here is what I think you are missing:
In Xcode, scroll down in the left menu to "Targets", right click "iTGB", click "Get Info". Ensure "Architectures" is set to Standard (armv6), "Base SDK" has iPhone Device 3.0. Scroll down to "Code Signing" set "Any iPhone OS Device" to iPhone Developer (when you open this ensure you see your certificate - if you don't you did not register it with Apple and your Xcode/keychain on your Mac right - see here: mobiforge.com/developing/story/deploying-iphone-apps-real-devices)
#19
The XCode iPhone project is the right one to use. and thanks for the links, Baneblade
11/30/2009 (11:35 am)
Be careful, the project with iTGB in is inside the XCode folder, not the XCode_iPhone folder ? If you running the XCode project it will not run on device as it is a mac application.The XCode iPhone project is the right one to use. and thanks for the links, Baneblade
#20
Okay, I finally got the iPhone test file to work just fine on the simulator. But I didn't use the method detailed above, I didn't go through Xcode. Instead I used the "Build Project" icon and went straight from iTGB. And it built successfully, opened the iPhone simulator automatically and worked like a charm.
I didn't see the "Build Project" icon mentioned anywhere in the documentation, did I miss it?
12/01/2009 (1:29 pm)
Color me confused. :)Okay, I finally got the iPhone test file to work just fine on the simulator. But I didn't use the method detailed above, I didn't go through Xcode. Instead I used the "Build Project" icon and went straight from iTGB. And it built successfully, opened the iPhone simulator automatically and worked like a charm.
I didn't see the "Build Project" icon mentioned anywhere in the documentation, did I miss it?
Torque Owner Eyal Erez
platform : 2008 iMac
OSX Version : 10.5.7
XCode Version : 3.1.3
iPhone SDK : 3.0.0 sdk for leopard
iTGB Version : T2D_iPhone_Beta_1_0 (aka iTGB 1.3 beta)
Devices tested on : iPod Touch 2nd Gen / iPhone 3G
Targeting iPhone 2.2.1, but it is also working on 3.0.
I can't compile it using GCC4.2, only 4.0 works.
I never tried the simulator and honestly, I don't even bother with developer provision profile. I have 1 generic ad-hoc profile that I use for all my games. and a separate appStore profile for each game.