I've attempted to run lldb from a shell and select an already booted & running simulator, but lldb can't "see" it:
$ xcrun lldb # or simply `lldb`
(lldb) platform select ios-simulator
Platform: ios-simulator
Triple: x86_64h-apple-macosx
OS Version: 10.15.3 (19D76)
Kernel: Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64
Hostname: 127.0.0.1
WorkingDir: /Users/vvalekseev/Developer/avito-ios/Avito
SDK Path: "/Applications/Xcode_11_3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
No devices are available.
(lldb) platform connect <UDID>
error: no device with UDID or name '<UDID>' was found
xcrun simctl list shows that UDID as booted.
Is there something specific I have to do in order to make lldb work with simulators?
I encountered this.
Although I didn't find a solution to platform connect successfully,
I found it unnecessary actually.
I tried the line in Xcode's lldb, it gave me the same error.
But somehow I can debug with Xcode apparently.
Thus, I tried
xcrun lldb <path to my .app file>
(lldb) process attach -n <name of my app> -w // wait for app to launch
// launch the app in simulator
Also, this works
xcrun simctl launch <com.company.app>
<process id output>
(lldb) process attach -p <process id output>
It turned out we don't need to connect to the simulator before we attach to a process.
Thanks, but I was up to use the most recent versions of lldb, not the one that is being shipped with Xcode. Do you know a way to point Xcode to a different lldb?
I think there are some words of mine misunderstood.
I brought up Xcode just to point out that
if a problematic lldb can work WITHIN Xcode,
it should be able to work WITHOUT as well.
My lines work without the prefix xcrun.
> lldb <path to .app>
(lldb) process attach -n <name of app> -w