Laevand
Laevand

Reputation: 892

Swift po causes error 'Failed to load linked library Metal'

How can I print out a Swift variable's value in XCode 6 GM with LLDB? It seems to be broken since early betas. But at the same time po works perfectly fine in Objective-C code

I've previously tried all XCode 6 betas and got the same result. Even when I start a new project from scratch it's all the same. For example, I put a breakpoint in func application(application, didFinishLaunchingWithOptions)

(lldb) po application
error: Error in auto-import:
Failed to load linked library Metal of module sandbox - errors:
Looking for "@rpath/Metal.framework/Metal", error: not a string object

I've never imported or linked against Metal.framework in any of my projects. Does there exist any way to solve this?

Upvotes: 12

Views: 1777

Answers (3)

Laevand
Laevand

Reputation: 892

The bug was fixed in XCode 6.1

Resolved Issues - Debugging

Swift expressions like 'expr', 'p', and 'print' that are evaluated from the LLDB prompt in the debugger console will now work on 32-bit iOS devices. (18249931)

https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Chapters/xc6_release_notes.html

Upvotes: 3

Bassam Mehanni
Bassam Mehanni

Reputation: 14944

Don't know the reason that po is broken in xCode 6, but I am able to print an object by

  • Right clicking an object in the Debug Area

  • and clicking -> Print Description of "OBJECT_NAME"

Hope this will help someone else, until the xCode bug is fixed

Upvotes: 3

anatoliy_v
anatoliy_v

Reputation: 1800

Metal.framework is a new framework provided by Apple in iOS8. Seems like AVFoundation has references to it. I think you getting this error running your app on iOS7 device or simulator. Try to check on iOS8.

Upvotes: 0

Related Questions