Skip to content

Instantly share code, notes, and snippets.

@capricorn
Last active July 16, 2024 14:11
Show Gist options
  • Save capricorn/3a16bce29152fae1549ddf767fd90e01 to your computer and use it in GitHub Desktop.
Save capricorn/3a16bce29152fae1549ddf767fd90e01 to your computer and use it in GitHub Desktop.
Import Xcode project to swift repl

One approach is:

  1. Run project in Xcode
  2. Pause execution using the debugger
  3. In the lldb prompt, type repl. This may need to be attempted twice.
  4. Once in the repl, do @testable import $PROJECT_NAME, substituting $PROJECT_NAME for the name of your project.

The project code is now accessible from the repl. Note: If the project name contains dashes, convert them to underscores when importing on step 4. (To exit the repl, type ':' and hit enter.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment