title: How can I fix the error "Cannot create Swift scratch context" when using LLDB
body: <p>Whenever I run an LLDB expression in swift mode I get the following error. </p>
  
  <blockquote>
    <p>Cannot create Swift scratch context (couldn't load the Swift
    stdlib)Cannot create Swift scratch context (couldn't load the Swift
    stdlib)Stack dump:
    0.    Program arguments: /Applications/Xcode.app/Contents/Developer/usr/bin/lldb [1]    77539
    segmentation fault  lldb</p>
  </blockquote>
  
  <p>it does not matter what I try to import. </p>
  
  <pre><code>~ ❯❯❯ lldb
  (lldb) expression -l swift -- import AppKit
  Cannot create Swift scratch context (couldn't load the Swift stdlib)Cannot create Swift scratch context (couldn't load the Swift stdlib)Stack dump:
  0.  Program arguments: /Applications/Xcode.app/Contents/Developer/usr/bin/lldb
  [1]    6665 segmentation fault  lldb
  ~ ❯❯❯ lldb                                                                                                                                                        ✘ 139
  (lldb) expression -l swift -- import Foundation
  Cannot create Swift scratch context (couldn't load the Swift stdlib)Cannot create Swift scratch context (couldn't load the Swift stdlib)Stack dump:
  0.  Program arguments: /Applications/Xcode.app/Contents/Developer/usr/bin/lldb
  [1]    7122 segmentation fault  lldb
  ~ ❯❯❯ lldb                                                                                                                                                        ✘ 139
  (lldb) expression -l swift -- import UIKit
  Cannot create Swift scratch context (couldn't load the Swift stdlib)Cannot create Swift scratch context (couldn't load the Swift stdlib)Stack dump:
  0.  Program arguments: /Applications/Xcode.app/Contents/Developer/usr/bin/lldb
  [1]    7225 segmentation fault  lldb
  ~ ❯❯❯                                                                                                                                                             ✘ 139
  </code></pre>
  
  <p>What's interesting is the very same commands work when using the LLDB within Xcode.</p>