16

Until very recently, instruments worked fine. I don't know what I did to make it mad, but now it won't attach to any device that I try to Profile with; no device at all. I've tried an iPhone, iPad, and 2 iPod touches; no luck! I'm using XCode 4.

Here is the sequence of events:

  1. With device attached, click Product->Profile.
  2. App compiles onto device.
  3. Instruments launches, but an error sound is heard
  4. The record button is grayed out.
  5. Choose Target doesn't allow me to attach or choose target (empty list).

Background points:

  1. Profile is set to Debug build within the Scheme of the project. This is true for all static libs as well.
  2. I AM able to run the Core Animation instrumentation on the device, but only when I launch I launch Instruments separately from Xcode. In this scenario, i can only attach to an existing executable; I can't use "Choose Target" (the list is empty).
  3. I tried restoring one of the devices to factory settings...still didn't work.
  4. Looking at the Console of the device, i see these messages:

    unknown lockdownd[17] <Error>: 001d5000 handle_connection: Could not receive USB message #16 from Instruments. Killing connection
    unknown com.apple.mobile.lockdown[17] <Notice>: Could not receive size of message
    

Any help would be most appreciated

haider
  • 2,418
  • 3
  • 24
  • 26
  • I'm getting the same problem (empty select target menu) with Instruments in Xcode 4 and all of my devices. However, it seems to be working fine with the simulator. So if you need to use it ASAP, you can choose a simulator and select Product > Profile and it should work. Hopefully a solution is found soon to get this working on real devices though. – Ben Baron Jun 14 '11 at 03:04
  • thanks ensteinx2. yeah, i've been using it on simulator for allocations and leaks, but we both know its not enough to test there. hoping someone knows how to fix this – haider Jun 14 '11 at 17:13
  • I tried every possible scenario (Install and clean install of Xcode 4, Going back to Xcode 3 and installing Xcode4 atop even reinstalled the OS!) and I'm still having the same problem! Here are more details after I click on more details in the Xcode About window: Developer Information: Version: 4.0 (4A2002a) Location: /Developer Applications: Xcode: 4.0.2 (99) Instruments: 4.0 (3538) Dashcode: 3.0.2 (333) SDKs: Mac OS X: 10.6: (4A2002a) iPhone OS: 4.3: (8H7) iPhone Simulator: 3.2: (7W367a) 4.0: (8A400) 4.1: (8B117) 4.2: (8C134) 4.3: (8H7). Not sure if Instruments' version number is indicator? – Mac Jun 14 '11 at 20:48
  • Bang on, same problem here. Adimitri's solution is not relevant for me, I had this problem prior to installing xcode 4.2 in a separate directory. – Codezy Jun 15 '11 at 14:27
  • Same problem here. Apples tooling is utter crap compared to every other platform I've seen so far. – Johannes Rudolph Jun 30 '11 at 17:42
  • @ Johannes, exactly which mobile platform SDKs have you developed for? I call bs on you. But on topic, one cannot accurately test for things like memory leaks in the simulator. You'll get scads of bogus false positives. – isaac Jul 06 '11 at 21:05

5 Answers5

7

There was a discussion on the apple developer forums about this issue:

Instruments does not work on Xcode 4 with device

It appears that different Apple products will change/update the MobileDevice framework. Some of these updates break the Instruments integration.

To fix this on my own machine, I installed the iTunes 10.5 beta v6. Fire up XCode, and I'm back in business Instrumenting on my device.

MikeG
  • 4,015
  • 2
  • 27
  • 25
2

May be worth a try - I had the same issue - I changed 'Targeted Device Family' from 'iphone/ipad' to 'iphone' in the build settings and this solved it for me.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
Tim
  • 21
  • 1
2

I quit Xcode and Instruments, relaunched them, did a clean build, and then did Product->Profile, and Instruments magically started working again with my device. Go figure.

sffc
  • 6,186
  • 3
  • 44
  • 68
  • Unbelievable. All those different solutions, and this is the only one that worked. The Nintendo Solution continues to amaze. – Nerrolken Nov 25 '15 at 20:51
1

Have you also installed the latest developer builds of XCode 4.2 w/ the iOS 5.0 builds? I've found that even if you install it in a separate directory, it does something to the instruments in the original XCode 4 directory. Using the latest version of XCode will allow you to use it properly.

adimitri
  • 1,296
  • 9
  • 13
  • thanks. I can confirm using released XCode 4 Instruments causes issues with having latest dev build of Xcode installed as well. If I directly start the instruments.app of the latest XCode4.2 Dev Build, I can select _Choose Target_ and successfully do leak and allocation profiling. – marcus Jun 15 '11 at 20:12
  • The minute I connect my iOS device, Instruments won't let me choose a target regardless of whether I start Instruments directly or Cmd-I from Xcode. – Mac Jun 15 '11 at 21:37
  • Using the Xcode 4.2 version of instruments solved this problem for me. – Jessedc Jun 17 '11 at 04:20
1

Workaround: Go back to Xcode and use Cmd-Tab to switch to Instruments. I have to do that twice to get Instruments running again.

referred

Sisira
  • 19
  • 3