I just got the xcode 4 dev release. Anyone tried it with cocos2d yet? If so any issues?
-Jim
XCode 4 and cocos2d
(32 posts) (21 voices)-
Posted 1 year ago #
-
Templates from Cocos2d are not showing :/
Posted 1 year ago # -
my templates are in /Library/Application Support/Developer/Shared/Xcode :/
Posted 1 year ago # -
I have successfully compiled my cocos2d projects under Xcode 4 dev preview 2.
Two gotchas I noticed:
If you have included cocos2d Xcode project in your project as a sub-project as per the Clint Harris tutorial (mentioned in http://www.cocos2d-iphone.org/wiki/doku.php/resources:iphone_recommended_reading)
you may find that your app fails to run on your iOS device but is fine in the simulator. I found that the build settings for the included cocos2d project were set to LLVM Compiler and this was being applied even though my app project build settings specified GCC 4.2. When I changed the cocos2d project build settings to compiler GCC 4.2 and did a clean and rebuild, my app ran on my iOS device.I have not had any success compiling with the LLVM compiler and have yet to find out how to set Xcode 4 to use the LLVM debugger mentioned in the release notes. I will update this post with progress if it occurs :)
The other gotcha was the rather buggy Link Binaries feature in Xcode 4 which tends to crash when you drag the cocos2d libs from the cocos2d Xcode sub-project to your target. Not only does it try to attach them (with the full path specified) to your project which is rather un-desirable but there appears no way to drag more than one library at a time. Hopefully this will be resolved in the next Xcode pre-release but for now I'm dragging my cocos2d libraries to my app target in Xcode 3.2.x
Regards,
Derek.Posted 1 year ago # -
I also had trouble compiling for simulator, but resolved it by deleting the "build only active architecture" and the "valid architectures" entries. You can use the LLVM debugger by editing your active scheme (under the run settings)
What I haven't quite figured out, is how to change between the various configs (ie: between debug and release).
Posted 1 year ago # -
After a bit of playing around I can compile the following to the iOS 4.0 iPod Touch G2 32GB device:
App Product Compiler cocos2d Project Compiler Edit Scheme->Launch->Debugger GCC 4.2 GCC 4.2 GDB LLVM GCC 4.2 LLVM GCC 4.2 GDB LLVM Compiler 2.0 LLVM Compiler 2.0 LLDB (cannot debug in Xcode 4 but can launch app from device OK)Posted 1 year ago # -
Anybody figure out how to install the templates yet? Xcode4 isn't looking for them at /Library/Application Support/Developer/Shared/Xcode. There is a new directory called /Xcode4/Library/Xcode/Templates that contains the files File Templates and Project Templates. I modified install-templates.sh to install in that location but I still couldn't get any Cocos2D templates to show up in the Choose a Template For Your New Project menu. Is Xcode4 handling templates differently, or are they not allowing you to install custom templates at this point?
Posted 1 year ago # -
@dbolli, I've had the same experience as you. Can't seem to get the LLDB debugger to work. XCode says "Running app on iphone", and after a bit, the app doesn't run, and XCode says "Finished". Leave all the rest of the settings with LLVM 2.0 compiler, and change to GDB debug, and it works fine. Really strange.
Posted 1 year ago # -
For now i am not using it. It crashed too many times for me to find it useful.
-JimPosted 1 year ago # -
Reviving this... has anybody had any luck installing the cocos2d templates with XCode 4 Developer Preview 2? Share the love if you have!
Posted 1 year ago # -
Just saying, but xcode 4 is under NDA and shouldn't be talked about on a public forum. Also, why don't you just create a project with xcode 3 and open it with 4 ?
Posted 1 year ago # -
I use xcode 4 as well and started project with 3 and then opened it with 4
Havent had any major problems with 4, since i am new to xcode 4 and Obj C i thought of familiarozing myself with the new version of xcode.
Anyway you have to complile with xcode3 bofore subitting your app to apple of what ive read
Posted 1 year ago # -
XCode 4 has an own folder. It's /XCode4/ in my case. So you need to change the script.
Posted 1 year ago # -
why don't you just create a project with xcode 3 and open it with 4 ?
Smack-head-on-desk-obvious now that you mention it! Thanks!
Changing the script did no good, I think XCode 4 behaves differently when it comes to saving/loading templates. As far as the NDA goes, I think surely we are allowed to acknowledge its existence? :)
Thanks for the help!
Posted 1 year ago # -
Actually, no you're not allowed to acknowledge its existence on a public forum. Not that I care that much, I aint a mod here, but this thread is definitely against the NDA.
I'm glad I could answer your question though.
Posted 1 year ago # -
Hi there,
Just some information on the xCode 4 issue. I did it the hard way and found out the latest xCode 4 GM seed installs over the SDK 3.2.5 and like you all know by now that the template system is deferent between both versions the cocos2d template doesn't work at the moment. What I did was re-install SDK 3.2.5 back and then I renamed the Developer folder to Developer v3.2.5. After I did that I did a clean install of xCode 4, which created a new Developer folder and renamed that to Developer v4.0 just for safety.
Now I have both versions and I use v3.2.5 to create the Cocos2d projects and I use v4.0 to edit and test around with it. Hope this helps for ones that really want to try it out and still wants v3.2.5 to be there as a backup.
Posted 1 year ago # -
Did you manage to "share" an adhoc cocos app with the GM ?
I have two problems :
- it creates two targets in the same archive ( my app plus cocos lib)
- I don't get the nice ipa or the option to sign it or the option to mail it...Any ideas ?
Posted 1 year ago # -
@Nico... I was having the same problem and found this solution on the Apple Developer Forums.
1) Select your project in the Project Navigator on the left.
2) Select your static library in the Targets section of the pane just to the right.
3) Find "Skip Install" in the Deployment section of the build settings, and change it from No to YesYou may need to click the 'All' filter to the left of the search box if you don't see the "Skip Install" setting in step 3.
Posted 1 year ago # -
So the same thing happened to me, with XCode 4 installing over my older version of XCode leaving me in the dark with regards to Cocos2d.
Now I dont really care about the older version of XCode simply because im a beginner and would rather learn 4 (its AMAZINGly easier to use) - but would it be possible for someone to simply upload empty projects created from the cocos2d templates used in 3.2.5? That way those of us using 4 can just copy them, rename them, and create a new project from that (at least until a working template system is figured out).
Really that would be awesome and amazingly helpful.
thanks guys!
Posted 11 months ago # -
@salmansqadeer, the templates are barebones cocos2d projects with variables in the filenames and source code which are replaced by Xcode when you create a new project with a template. You can download the templates from here (thanks to hm50 for posting.)
Replace variables like PRODUCT_NAME and __MyCompanyName__ in file names and in the source code. You'll also want to go through the project settings and set your product name.
Posted 11 months ago # -
If you are still looking for xcode 4 to work with cocos2d, here is the solution i tried and worked (by riq)
http://www.cocos2d-iphone.org/archives/1412* Get the latest release of cocos2d cocos2d-1.0.0-beta_templates.tar.gz
* un-tar it in ~/Library/Developer/Xcode/Templates folder
* Close Xcode and reopen, this time when you create new project, it will show the new templates for cocos2d, box2d and ChipmunkPosted 9 months ago # -
hi there, I dont want to start new thread,
so what version of xcode is the newest? sdk 4?
is sdk 4 working with cocos2d 0.99.5?
Im using 3.2.4sdk and 0.99.5 cocos2d, but I would like to submit app for selling, will it works or I need sdk 4? thanks...
Posted 8 months ago # -
@vogueestylee: It should work, but I have not tested it.
Posted 8 months ago # -
riq - what didnt you tested :)
1) sdk 4 working with cocos2d 0.99.5
or
2) 3.2.4sdk and 0.99.5 cocos2d, but I would like to submit app for selling, will it works or I need sdk 4
:)
I have just wrote the email to apple about accepted version of sdk, I will let you know...
Posted 8 months ago #
Reply »
You must log in to post.