Friday, October 25, 2013

Cocos2D - How to build and run the Samples on MacOsX and Xcode

Running Cocos2d samples in XCode4 is not simple. I see many people complaining that their scheme list is totally cluttered by the dozen projects in Cocos2d and that some are missing.

This is caused by the new XCode4 structure with these "schemes" and "Product". I don't like them! The previous Project and build target were more friendly.

If I load Cocos2d workspace I see three Projects

  • cocos2d-mac
  • cocos2d-ios
  • cocos2d-ios -PerformanceTests.

When you click in the Xcode4 scheme box you don't see any sample there, there is a bunch of MacOS targets ActionTest, ActionEaseTest etc, there are some IOS targets like FontLabel, but no IOS samples.

If you click on the cocos2d-ios project you can see the Project Summary, and verify that the sample targets are there. So how come the don't appear in the "Scheme/Targets" list? From what I can see it, seems the only one visible are the first one in the macos project.

Apple removed the "build target" and "run target" from the Product menu so we are stuck, or maybe not.

The solution is simple.

  • Go to the Schemes menu by typing Command - < for Edit Scheme
  • in the left column click on Run
  • In the info panel you can select debug or release
  • Just below in executable you can click on the box and now see all the samples.
  • Select the one you want to build
  • Return to the scheme button in top left of XCode4 and click
  • now you should see all the IOS samples and select Device, Simulator etc
Voilà. If you find this info useful please click on the Google +1 below or post questions.

Sunday, November 18, 2012

IOS 6.1 BETA 2

IOS6 Beta 2 is available

I hope Apple corrected the bugs in the Maps. Some of our clients are screaming, we are too.

Thursday, October 13, 2011

IOS5 Bricked my device

You bricked your Apple device?

Most developers use a different technique to update their IOS and this generally works even if the device is bricked.

The problem is that you may loose your data if you don't have a backup.

Disclaimer: No warranty that this will work. If you try this on a working device you can brick the device. Do that at your own risk!

1 - Try a Reset

  • Hold the Power button and the Home Button until you see an apple
  • Release and press power to see if the device reboots

2 - Download ipsw file from Apple and flash

Download the iPSW file corresponding to your device. IPSW are the firmware files they are coming from Apple and that's what iTunes does install without telling you.
  • Plug in your "bricked" device via USB to your iTunes Computer
  • In iTunes Option+click on the Check for Update button in iTunes.(To wipe your device and do a clean install, Option+click on Restore.)
  • iTunes will display a file dialog
  • Select the ipsw you downloaded
  • IOS will be installed. You can see a white progress bar, Be patient
  • When it is finished iTunes can prompt you for a device backup to restore
  • Follow the instructions and be patient. This can take an hour if you have a lot of stuff
Other methods

3 - Reset & Restore

  • Hold the Power button and the Home Button until you see an apple
  • Release and press power to see if the device reboots
  • If not plug your device via cable to iTunes
  • Select your device in iTunes left column
  • Click Restore. iTunes should go and fetch the latest IOS from Apple
    You should see a white horizontal progress bar download the setup/install
  • When the IOS update is finished iTunes will ask you for a previous backup to restore
  • You can say no at this time and verify that your device is OK or if you have a backup select and click. If you say no you can always restore later.
  • Sync your device. This will take a good hour if you have a lot of stuff
4 - DFU - Digital Firmware Update

How to enter iPhone DFU mode

  • Turn the device off (hold down the power button at the top of the iPhone) 
  • Hold down the sleep/power button and home button together until device shuts off
  • Continue to hold down the Home button ad release sleep/power
  • While holding Home connect your device to iTunes on your computer used to sync
  • You should see a USB cable and an iTunes icon on your screen
  • Release the Home button
  • Restore as shown above step 4 (select device and restore)

Exit DFU mode on iPhone

Exit out of DFU mode by holding down the Home and sleep/power buttons on the iPhone while connected to iTunes. Then just hit the power button as and this should reboot the device as usual.