Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Route App Output to VS Code Debug Console #97

Open
FelixLisczyk opened this issue Dec 18, 2024 · 0 comments
Open

Feature Request: Route App Output to VS Code Debug Console #97

FelixLisczyk opened this issue Dec 18, 2024 · 0 comments

Comments

@FelixLisczyk
Copy link

FelixLisczyk commented Dec 18, 2024

Currently, the SweetPad extension doesn't properly route app console output to VS Code's Debug Console:

  • iOS simulator app output appears in VS Code's terminal instead of the Debug Console
  • macOS app output only appears in the terminal after the app has been terminated, making real-time debugging difficult
  • The "console": "internalConsole" launch configuration option is not supported

This makes debugging challenging as users miss out on the Debug Console's advantages such as filtering options and integration with the LLDB debugger. The delayed output for macOS apps particularly impacts the debugging workflow, as developers can't see logs until after the debugging session ends.

Current Behavior

  • iOS apps: Output appears in VS Code's terminal in real-time
  • macOS apps: Output is buffered and only appears in the terminal after the app terminates
  • Launch configuration doesn't support console output configuration:
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "sweetpad-lldb",
      "request": "launch",
      "name": "Attach to running app (SweetPad)",
      "preLaunchTask": "sweetpad: launch",
      // "console": "internalConsole" - currently not supported
    },
  ],
}

Proposed Solution

  1. Redirect all app output to VS Code's Debug Console, including:

    • NSLog messages
    • print statements
    • System logs
    • stderr/stdout
    • Crash logs
  2. Support the standard VS Code debug console configuration:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "sweetpad-lldb",
      "request": "launch",
      "name": "Attach to running app (SweetPad)",
      "preLaunchTask": "sweetpad: launch",
      "console": "internalConsole"
    },
  ],
}

Expected Behavior

  • When launching an app through SweetPad, all console output should automatically appear in VS Code's Debug Console
  • Output should be properly formatted and searchable
  • Users should be able to use VS Code's built-in filtering and search capabilities
  • The experience should match what developers are used to in Xcode

Technical Considerations

  • For iOS simulator apps, implement proper redirection from the simulator's output stream to VS Code's Debug Console
  • For macOS apps, capture and redirect stdout/stderr streams
  • Ensure proper integration with LLDB debugger output in the Debug Console
  • Maintain output formatting and colors where applicable
  • Support real-time streaming of log output

Benefits

  1. Better debugging experience:

    • All output in one place (Debug Console)
    • Better filtering and search capabilities
    • Consistent with other VS Code debugging experiences
  2. Feature parity with Xcode:

    • See the same output as in Xcode's console
    • No missing logs for macOS apps
    • Proper integration with debugging workflow
  3. Improved productivity:

    • No need to switch between terminal and Debug Console
    • Better log readability and organization
    • Easier to track issues during debugging sessions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant