nisargjhaveri / vscode-ios-debug

iOS debugging in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=nisargjhaveri.ios-debug
86 stars 10 forks source link

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

Open kuglee opened 1 year ago

kuglee commented 1 year ago

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

nisargjhaveri commented 1 year ago

@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.

kuglee commented 1 year ago

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
nisargjhaveri commented 1 year ago

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.

kuglee commented 1 year ago

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.

markst commented 1 year ago

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

yushihang commented 2 months ago

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