Open wr-fenglei opened 1 month ago
Hi! Actually debugging currently doesn't work on physical devices. You can only launch app on physical devices.
To fix error that you've mentioned please update the extension to the latest version and try to launch using ▶️ button on the extension panel.
Thank you very much, I can run it on a physical device.
I would be extremely grateful if you could explain the challenges of debugging on a physical device.
I'd like to try implementing this feature and hope to be of some help.
That would be amazing @wr-fenglei! I was trying to run it on the device today, and having debug support would be wonderful!
In the latest version (0.1.34), I've added the --console option for launching on physical devices. This option will redirect stdout to the extension, allowing you to print debug information on a physical device.
--console — Attaches the application to the console and waits for it to exit. devicectl will wait for the app to terminate. Catchable signals sent to devicectl are forwarded to the app. If the app is not already running, its standard streams will be connected to devicectl's standard streams.
I'd like to try implementing this feature and hope to be of some help.
Thank you! That would be amazing! 💜
I think a good starting point for configuring proper debugging with LLDB is to check this comment in the Flutter project: https://github.com/flutter/flutter/issues/133465#issuecomment-2159512125. From my understanding, launching an LLDB session with devicectl
works only with Xcode 16 and requires running these commands in the LLDB session.
(lldb) device select <device-identifier>
(lldb) device process attach --pid <pid>
In my extension, I heavily rely on the CodeLLDB extension for LLDB debugging and my extension just provide the correct options to this extension based on project information. Most of the logic is located in the DebuggerConfigurationProvider
class. Additionally, I’ve prepared a document on how to debug the extension on a local machine. This is also applicable for development, but rememeber to fork the project instead of just cloning it: Debugging extension.
If you have any other questions or ideas, don't hesitate to contact me
Thank you very much for creating this plugin. I really like it.
However, I've found that I can't debug on a physical device. Is there something wrong with my configuration?
My plugin version is 0.1.33.
I'm using Xcode 15.2, and my phone's system is iOS 17.6.1.
My launch.json configuration is as follows:
When I use VSCode's debug feature, the Terminal outputs:
When I use the command: SweetPad: Build & Run (Launch), the Terminal outputs:
When using VSCode's debug feature, the --device parameter is: iosdevice-00008020-000B34D6012A003F (may be wrong)
When using SweetPad's debug feature, the --device parameter is: 00008020-000B34D6012A003F
Additionally, when I use SweetPad: Get app path for debugging, it pops up an error:
I've noticed that when running on a physical device,
build.lastLaunchedAppPath
is not updated. I'm not sure if this is related.I would greatly appreciate if you could look into this issue. I'm really looking forward to debugging on a physical device.