views:

444

answers:

2

I'm trying everything i can to get instruments to profile my app on the actual iphone device, but it won't work no matter what i do. I tried the solution from http://stackoverflow.com/questions/379983/does-instruments-objectalloc-leaks-require-the-simulator but that didn't work. Most of the time i get nothing of use from the console, but one time i did receive this error:

Mon Aug 31 11:27:48 unknown lockdownd[14] : (0x83d400) handle_connection: Could not receive USB message #13 from Instruments. Killing connection

I'm not sure what could be causing this; has anyone else seen this and know a solution?

A: 

I eventually got it to work; not sure how but its working now (although incredibly slow).

Kevlar
A: 

Same problem - it worked the first two times, then after that never again (even after restarting Xcode, deleiting the device, etc).

Eventually I resorted to:

  1. Set XCode to display the Console
  2. Run with Performance Tool (instruments starts, and goes "BEEP" with no error - Apple "forgot" to include the error message, I think. ARGH!)
  3. Build&Run on device
  4. Once the (gdb) appears in console, go to Instruments and select "Attach to Process" from the drop-down at top
  5. If you cannot see the name of your debugging app, wait a second, and try again
  6. Eventually your app appears in the list of alread-running stuff, so select it
  7. Hit the Record button

On subsequent runs, Instruments will remember the name of your app, but will show an error if you hit "record" too soon. So you just keep hitting record and doing "OK" on the process it tries to connect to until it stops messing around and does what it's supposed to.

So far (20 odd runs) this works everytime. Obviously, it would be nicer if it just worked properly, without this manual hackery, but Apple is reporting zero error messages even to system console, so there's nothing we can do!

Adam