This is a follow-up question to How can I use Swift REPL with iOS SDK. I have an app named Venmo
which is already running on a simulator:
and I can see it in the Activity Monitor:
I would like to open a Swift REPL in which can use classes defined in the Venmo
project. Following the instructions in that answer, I first find the app in my DerivedData
directory;
$ cd ~/Library/Developer/Xcode/DerivedData
$ find . -name '*Venmo.app'
./VenmoWorkspace-apbzqcexodswkdfenhxlkpnlmvsx/Build/Products/Debug-iphonesimulator/Venmo.app
Then I launch a standalone LLDB following https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-terminal-workflow-tutorial.html. However, if I try to process attach --name 'Venmo'
, I get an attach failed: could not find a process named Venmo
error:
~/L/D/X/DerivedData>
lldb ./VenmoWorkspace-apbzqcexodswkdfenhxlkpnlmvsx/Build/Products/Debug-iphonesimulator/Venmo.app
(lldb) target create "./VenmoWorkspace-apbzqcexodswkdfenhxlkpnlmvsx/Build/Products/Debug-iphonesimulator/Venmo.app"
Current executable set to './VenmoWorkspace-apbzqcexodswkdfenhxlkpnlmvsx/Build/Products/Debug-iphonesimulator/Venmo.app' (x86_64).
(lldb) process attach --name 'Venmo'
error: attach failed: could not find a process named Venmo
(lldb)
I don't understand why LLDB can't find this process, even though I see it in my Activity Monitor?