Reputation: 8863
Normally I'm using LLDB from Xcode, but for some cases I would prefer using Terminal. I tried to type in "xcrun lldb" , and then I set lldb mode, but how do I set the right target?
Upvotes: 5
Views: 5828
Reputation: 1481
iOS Simulator
$ lldb
> process attach -n "AppName" -w
Then start app in iOS Simulator (ioslib can do this from command line). LLDB will connect once it discovers the app process.
iOS Device
Use ios-deploy (ios-deploy -d -W -b path/to/foo.app
). It will launch and connect an LLDB session.
OSX App
process attach -n "AppName"
in LLDB might work (not verified).
Upvotes: 3
Reputation: 112865
From the Apple docs:
Specifying the Program to Debug
First, you need to set the program to debug. As with GDB, you can start LLDB and specify the file you want to debug using the command line. Type:
$ lldb /Projects/Sketch/build/Debug/Sketch.app Current executable set to '/Projects/Sketch/build/Debug/Sketch.app' (x86_64). Or you can specify the executable file to debug after it is already running using the file command:
$ lldb (lldb) file /Projects/Sketch/build/Debug/Sketch.app Current executable set to '/Projects/Sketch/build/Debug/Sketch.app' (x86_64).
A simple Google finds this.
Upvotes: 0