Unit Test target doesn't run on Xcode 4.5
Asked Answered
G

3

10

I'm on the latest beta version of Xcode (Xcode 4.5 with iOS 6.0). I've got an xcode project for an iphone app and I want to add a Unit Test target on it. I've followed carefully the instructions given on this page but I can't run the tests. Here's the message I read in the console:

Failed to find SDK: '6.0'  
error: failed to attach to process ID 0

The target corresponding to the main application runs perfectly well on the iPhone 6.0 simulator though.

Where can I have made a mistake?

Garibald answered 27/7, 2012 at 13:27 Comment(3)
Any results on your investigations?Welty
no success so far... still no test in my project which is a shame :(Garibald
Ok - it's running on my side now. I had exactly the same error. What I've done: (1) Clean my project (2) Build the project from the scratch. But I would not give a dim that this will help you - sorry.Welty
T
17

Xcode -> Preferences -> Locations -> Command Line Tools => Select the one matches with SDK.

EDIT:

EDIT 2: For some people, the above method works. If not, please try:

It seems that this issue was a result of switching between more than one version of SDKs, and could be solved by specifying the current SDK as the active one with a terminal command(, which requires root privilege):

$ sudo xcode-select --switch <path-to-your-current-xcode.app>
Tristram answered 30/8, 2012 at 2:56 Comment(1)
Don't know why you put a strikethrough on your first answer (Xcode -> Preferences -> Locations -> Command Line Tools => Select the one matches with SDK.) as that was what worked for me... The xcode-select did not fix that issue.Hideandseek
Q
1

I found that in order to get Xcode to attach to my unit tests, I had to use LLDB, GDB did not work.

Quaky answered 4/10, 2012 at 16:17 Comment(0)
A
0

I returned to an earlier snapshot that I had - the only change being that the compiler was set to GDB instead of LLVM - and surprisingly enough that seems to have worked perfectly.

Not sure why LLVM isn't working though.

Ardene answered 31/7, 2012 at 4:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.