Xcode does't print any debug logs after Attach to Process by PID or Name

855 views Asked by At

I use Xcode Version 10.2

Normal app debug print logs as expected, but when I want to test some delegate like

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
(NSDictionary *)launchOptions

I attach to process by PID or name option from Debug menu

enter image description here

Debug works as expected but in log windows is empty

enter image description here

Expected result: Show logs in debug after Attach to Process by PID or Name

1

There are 1 answers

0
Jim Ingham On

This is not possible with lldb.

Redirecting a process' stdout & stderr is not the sort of thing a debugger should do by default, since the debugger has no way of knowing whether the process you are attaching to was part of a pipeline or for some other reason wanted its stdout to stay where it was.

It isn't offered as an option because there isn't a robust supported way to redirect the stdout/stderr of a process from the outside.