Using Xcode tools like "Leaks"

Maybe this should be in another forum, but I think its a piece of information every one new to Corona SDK might need. For some of us, like myself, I’ve only done a few things in Xcode and Corona SDK is a great way for me to not have to deal with the complexities of Xcode + ObjectiveC + and insanely large API and lots of tools.

But there are times that we need to do some things in Xcode. Like using the console in the organizer. I’ve searched for a month trying to figure that one out. The “Console” tab right in front of my face was invisible until I saw a screen shot today. So to assume we know how to use Xcode as a Corona SDK user can be frustrating.

Anyway today’s topic is the “Leaks” tool. There seems to be suggestions that it can measure memory usage on an app running on a device. However when running it (“leaks” is a command line tool in /usr/bin) it seems to want to attach to a pid of a process running on the Mac.

Can someone take a moment and explain just how to use leaks to debug a Corona SDK app?

Thanks
Rob
[import]uid: 19626 topic_id: 9159 reply_id: 309159[/import]

I recommend you have a look at ‘Instruments’ for all your memory/performance testing needs. Much more fun than some cl gizmo and you can spend hours running all sorts of crazy tests on your app :slight_smile:

Look in xcode/applications

[import]uid: 6086 topic_id: 9159 reply_id: 33446[/import]

But how do you use it? I’ve plugged my phone in, brought up the organizer, and in the Xcode menu bar, its still grayed out.
[import]uid: 19626 topic_id: 9159 reply_id: 33459[/import]

I see, you run it outside of XCode. Attach your phone.

I can select my phone and then select the game as a target, but it launches and immediately dies…

"Target failed to run: Remove exception encountered: “Failed to get task for pid 206”
[import]uid: 19626 topic_id: 9159 reply_id: 33463[/import]

I am getting the following error within Instruments

"Target failed to run: Remove exception encountered: "Failed to get task for pid 168"

I have setup Instruments to measure Allocations and Leaks. I get this same error even after a reboot of the mac and iPad.

Does anybody have any suggestions as how I can get over this? [import]uid: 22878 topic_id: 9159 reply_id: 76525[/import]

Did you build your app for device using a “Development” provisioning profile or an “Ad Hoc Distribution”?

Your app has to be build with a development profile so it has the debugging symbols included.

I think this is the cause of your problem.

Rob
[import]uid: 19626 topic_id: 9159 reply_id: 76527[/import]

Sure is. Thanks robmiracle.

I did do a “Ad Hoc Distribution” build of the app.

Should there be any difference between a Development build as opposed to a “Ad Hoc Distribution”? I guess not. [import]uid: 22878 topic_id: 9159 reply_id: 76534[/import]

Yes, there is a huge difference. The Development version compiles with debugging information that Leaks uses.

Development provisioning profiles are also only good for a couple of months. [import]uid: 19626 topic_id: 9159 reply_id: 76538[/import]

@robmiracle
I assume you were able to solve your problem?
In reply #3 you were still having trouble, and I guess it was the provisioning profile.

A quick note:
Development provisioning profiles are now valid for one year at a time. It used to be 3 months, but Apple have changed the validity length recently. [import]uid: 70847 topic_id: 9159 reply_id: 76556[/import]

I had no clue what Dev provisional profile was for. Thank you for explaining what it does!

Naomi [import]uid: 67217 topic_id: 9159 reply_id: 76694[/import]

Another useful tool is:

/Developer/Applications/Graphics Tools/OpenGL ES Performance Detective.app
If you build your app with a developer cert., you can run this tool to see what the FPS count is on the device as you are running your app. [import]uid: 67839 topic_id: 9159 reply_id: 76715[/import]

Wow…good one! How come I’ve never seen this one?
Now I can finally see the actual framerate when I flip the switch in my app between 30/60 fps.

Thanks [import]uid: 70847 topic_id: 9159 reply_id: 76718[/import]

@elbowroomapps
Thank you for pointing out something new for me today. I guess this will be one of the last things I will learn of in 2011.

Thanks.

Looking forward to 2012: The year I learn more… [import]uid: 22878 topic_id: 9159 reply_id: 76735[/import]