Attach to running iOS application already running Xcode debugger
See original GitHub issueIs there a way to attach Android Studio/ IntelliJ to the running iOS application?
I have tried running the iOS application through Android Studio, and then trying to Xcode > Debug > Attach to process > Runner
, and I got the error:
error: attach by pid '425' failed -- tried to attach to process already being debugged
This would be great as it would allow debugging the iOS and dart code simultaneously, like we can do for Android Applications (by attaching to the Android process in Android Studio).
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
xcode - How to attach debugger to iOS app after launch?
Attach your device connected your Mac; Debug > Attach to Process by PID or Name; In the dialog sheet, enter the name of...
Read more >Connecting Xcode To A Running Process - Use Your Loaf
Build and run your App to install it on the simulator or device of your choosing. · Stop the Xcode debug session. ·...
Read more >Not able to attach Xcode debugger … | Apple Developer Forums
I would like to be able to start debugger using process name and launch the extension and be able to debug from first...
Read more >Advanced Xcode debugging trick - Medium
When your app is installed either on a device/simulator but not running. · In the Xcode Menu, select Debug -> Attach to Process...
Read more >Exploring Xcode's Debugging Tools - Cocoacasts
When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
flutter run
(same from the IDE) launches the app with lldb and stays connected. You can’t attach another lldb session through Xcode (that I’m aware of).I would start the app from Xcode, then
flutter attach
as @stevemessick suggested.If you need to launch the app through
flutter
instead of Xcode it’s more complicated–you would need toflutter run
, detach (“d”), attach from Xcode, thenflutter attach
again.Maybe @jmagman would have an idea about Xcode.
You might be able to launch your app from the command line, then try to attach both the Flutter debugger and Xcode debugger. I don’t know if that would work, but it may depend on the order of attachment. The Android Studio menu item is
Run > Flutter Attach
; it is also on the tool bar. Fair warning: Flutter Attach was designed to work for add-to-app projects; some people have reported success using it for regular apps, though. You might need to use additional arguments likeflutter run --start-paused --machine
. Some experimentation would be required.flutter help run
lists all the arguments. The--start-paused
arg is mostly used to ensure breakpoints are initialized before the app starts running. If you don’t need to debug initialization then you may be able to omit it. (It has been a while since I looked at the debugger code.)