vscode-ios-debug icon indicating copy to clipboard operation
vscode-ios-debug copied to clipboard

Console output is not appearing in the Debug Console if using the HotReloading package

Open kuglee opened this issue 3 years ago • 6 comments

Hi,

Thanks for this extension, it works great. One issue I've found is that the console output is not appearing in the Debug Console if using the HotReloading package. It is only written to the /tmp-ios-xxxx-stdout and /tmp-ios-xxxx-stderr.

It works fine in the Xcode console.

Here is an example project with HotReloading configured: https://github.com/nisargjhaveri/vscode-ios-debug

kuglee avatar Jan 22 '23 17:01 kuglee

@kuglee, thanks for reporting this.

Could you please mention some more concrete steps to reproduce this? It'll help me test. Also, the example project link seems to be wrong, it is just pointing to this project itself.

nisargjhaveri avatar Jan 24 '23 04:01 nisargjhaveri

Sorry, here's an example I made: https://github.com/kuglee/new

If you start the "Debug new Simulator" configuration, you'll see the issue. The app prints "hello" when it launches, but it only appears in the stdout file not on the Debug Console.

out

kuglee avatar Jan 24 '23 16:01 kuglee

Thanks for the info. I tried and I am able to see the logs as expected, including "HotReloading available ..." and "hello".

Can you please check and mention the version numbers for "iOS Debug" and "CodeLLDB" plugins?

I don't really understand why it'd not appear, especially since the logs are available in the ios-*-stdout file. We're using the logs.py script to get the output from the file to the debug console.

You can try these two things.

  1. Does output appear in the debug console for any other projects without HotReloading? Maybe try out the Sample App here
  2. If it does not, try manually including the logs.py in standalone lldb and see it that works.
    • Start commandline lldb client by running lldb
    • Run command script import logs.py in lldb prompt
    • Create a temp file somewhere and run follow <path/to/temp/file>
    • Write something in the temp file from another terminal and see if that appears in the lldb console.

Findings from these may help us find a solution.

nisargjhaveri avatar Jan 24 '23 18:01 nisargjhaveri

That's really strange.

I've tried the Sample App and it printed to the Debug Console just fine. After that I added the HotRealoading package and it stopped printing to the Console. 2

I've had to change task to build the Sample App scheme because otherwise xcodebuild could build the project. But then I tried to build the original without the HotReloading package with the Sample App scheme and it again printed to the Console so it didn't affect anything. 4

I'll try to investigate further.

kuglee avatar Jan 24 '23 19:01 kuglee

Seems to be the same case with the example project here: https://github.com/markst/hotreloading-vscode-ios

markst avatar Mar 20 '23 23:03 markst

https://github.com/nisargjhaveri/vscode-ios-debug/pull/22

yushihang avatar May 27 '24 14:05 yushihang