Thursday, August 5, 2010

Xcode 3, Instruments 4

This was a bit of a "duh" moment for me, but probably worth mentioning, despite being a "Captain Obvious" post.

I'm a big fan of what Apple's doing with Xcode 4, but in my opinion it's just not ready for production use yet. I'm using it for the book and occasional forays, but not for regular client work yet. However, I also run my machine using the 64-bit kernel, which means I can't use Shark without rebooting. I've been really looking forward to the Time Profiler template in the 4.0 version of Instruments as well as the two new OpenGL ES templates and the Energy Diagnostics template.

But, while grumbling about their lack in the current release version of Instruments, it struck me: you don't have to launch Instruments from the same folder you launch Xcode from. You can launch Instruments separately and attach it to a running process in the Simulator or on an attached iPhone. That means, you can launch Instruments from the Xcode4 folder instead of from the Developer folder. This allows you to develop and debug with the less-shiny-but-production-ready Xcode 3.x and also use the new Instruments templates like Time Profiler, OpenGL ES, and Energy Diagnostics.



8 comments:

tesseractor said...

As for me, I'm developing with 4 and testing/compiling/submitting with 3. I'm trying to get ready for the full switch, and really enjoying Xcode 4. Can you expound on where it's still unpolished?

That is a great tip about Instruments, however. I'm so used to running it through Xcode's menu that it wouldn't have occurred to me.

Jeff LaMarche said...

My biggest issue is with the key bindings - it doesn't pick up my old ones, and some of the ones I want to change aren't exposed yet in the new one. The lack of command-slash to comment and uncomment is particularly difficult. It's also a bit buggy - I can't add shaders to a project, it tries to compile them, but won't let me add them to the copy bundle resources build phase no matter what I do - have to go back to 3 to do that. Adding frameworks in 4 is a chore as of right now as well. Just lots of little annoyances that add up to a lot of wasted time right now.

Seventoes said...

It's not even in beta yet IIRC. It's not meant for real use, yet.

tesseractor said...

I see; all of that makes sense. Since I'm just using it for editing, I haven't run into many of the problems you describe. I'm not doing OpenGL, so I haven't had problems with shaders, I already have frameworks in the project, and as I said, I'm still using 3 for actual testing and building. For now, I really enjoy the assistant and version control views.

mbw said...

I can't seem to find any of the OpenGL instruments that were used in the WWDC talks. There was one instrument that gave you stats on how many redudant stage changes you made, and how much time was spent on vertex/fragment processing, etc...

In the WWDC talk it was called "OpenGL Analysis" ... does anyone know where that is?

Sly said...

I've been trying to find where this fabled OpenGL Analyzer instrument is. It's not installed with Instruments in Xcode 3.2.3, and it's not in the Xcode 4 Preview. Where is this elusive instrument? It's documented on developer.apple.com. People keep talking about it. I don't believe it exists.

NukemHill said...

Jeff,

I'm running into some interesting behavior with Instruments, and I'm not quite sure it's my fault. I've got an app that is ready for beta, and I'm running some last-minute Instruments tests on it, and am finding some odd memory leaks. The weird part of it is that when I ran these same tests a few weeks ago, the leaks weren't there. Especially in the Three20 code I'm using. I've not touched the code in quite a while, so I'm almost positive that it's not me.

Here's where I'm kinda scratching my head. I just upgraded my dev machine to a MacBook Pro i7. I'm running in 64-bit mode. I'm wondering if there are some issues with Instruments running in 64-bit mode that might be getting in the way. I'm about ready to reboot in 32-bit, just to satisfy my curiosity.

Have you heard of any such oddities? I did, in fact, have to re-install Xcode today, as I was attempting to run Instruments for the first time since I moved everything over from my old (original MacBook Pro). It was complaining about not being able to run in this configuration and to "check with the developer or re-install the app", or some such nonsense. I can't imagine I'm the only person in the world to be running Instruments while in 64-bit mode, though....

SEO Services Consultants said...

Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck! Web Design Company