One approach is:
- Run project in Xcode
- Pause execution using the debugger
- In the
lldb
prompt, typerepl
. This may need to be attempted twice. - 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.)