question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for debugging add-to-app flutter app

See original GitHub issue

I’ve switched my app to be the add-to-app setup in order to better support app extensions on the iOS platform. While this is working great, and it’s nice to have full control over the Xcode Project generation, the drawback is that I can no longer start/debug the app from VS Code.

Would it be possible to add a new debug configuration for starting a custom app and connecting to that one?

I imagine it would look something like this:

{
  "name": "Flutter",
  "request": "launch-custom",
  "type": "dart",
  "xcworkspace": "ios/MyApp.xcworkspace",
  "xcscheme": "MyApp"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Apr 30, 2019

Hmm, maybe not. I’ve opened a folder with a flutter and ios folder. The flutter root thus is in {workspace_root}/flutter, should that work? 🤔

Sort-of 😃

The problem here is that because you’re attaching (and not launching), we don’t know what part of your workspace is the project. I think if you create a launch.json and set the cwd to point at the flutter folder, probably that will fix it (since then we’d spot that it contained a pubspec that references the Flutter SDK).

To avoid confusion, if that doesn’t work - open a new issue with the details, and include a log (run Dart: Capture Logs, then run the attach command, then when it asks for Observatory URI, cancel it and click Stop Logging).

The other issue does look like a Flutter bug. I think the method for finding the Observatory URI is being changed to use mDNS (which should mean doing things in a specific order will not be required), but seems there’s something wrong with it. If you’re on master, you might be able to avoid it by switching to something like beta temporarily.

I don’t think there’s anything else for this issue so I’ll close it but feel free to post back on it if you have any questions about the above (for ex. if you can’t get the tasks/launch.json stuff working) and I’ll try to help out.

Thanks!

0reactions
DanTupcommented, Jul 23, 2019

You shouldn’t have needed to restart VS Code, though glad it’s working now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging your add-to-app module - Flutter documentation
How to run, debug, and hot reload your add-to-app Flutter module.
Read more >
How to run flutter release on Android debug buildtype for add ...
Our Android app uses flutter as add to app. How can I run release version of flutter when running our Android app debug...
Read more >
Flutter Add to App - Overview and Challenges by LeanCode
In that case, a Flutter add-to-app will help you add new features to ... The debugger wouldn't attach to some engines, and the...
Read more >
Announcing Flutter 1.12: What a year! | by Chris Sells - Medium
With Flutter 1.12, Add-to-App is now officially supported for adding one ... When you've built and debugged your Flutter UI, you have most ......
Read more >
How to Add Flutter to an Existing iOS and Android App
The add-to-app the feature supports integrating multiple ... Support for Flutter debugging and stateful hot reload by using flutter attach ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found