I write flutter codes in Android studio. I using ios native codes to supply platformview integrated in flutter widget tree. But how can I debug iOS native codes? addition: I am using iPhone simulator to debug?
Asked
Active
Viewed 1,461 times
2
-
By "native codes" do you mean platform-specific code written in Objective-C etc? – trojanfoe Apr 15 '20 at 14:34
-
@trojanfoe yes, native codes written by objective-c – zhouxinle Apr 15 '20 at 14:42
-
@zhouxinle, did you find solution yet? I have the same problem. If it's possible, wonderful! Otherwise, could we run flutter code on android studio and somehow we can see NSLog from Xocde, is it more feasible? – Scofield Tran Mar 11 '21 at 08:10
-
I think a answer of @Eldhose fro this post https://stackoverflow.com/questions/52770209/how-to-debug-ios-native-code-in-a-flutter-plugin work. The important part is you need to run app and attach debugger from flutter IDE before run app from xcode – Scofield Tran Mar 11 '21 at 08:38
1 Answers
-1
You can test it by run it from XCode, here you can set breakpoint and have the same iOS native debugging experience.
Luckily run it from XCode is really easy, just open ios
directory in the project and press the button to run it.
If you need more specific info let me know and I will answer you.
EDIT :
The project you need to open with XCode is:
For playing it you need to press top-left play button as in the image:

Lorenzo Imperatrice
- 977
- 8
- 23
-
sorry, I know how to debug in the xcode. but I need to debug the flutter codes and native codes together. – zhouxinle Apr 15 '20 at 15:04
-
@zhouxinle you said that you need to debug the native code of a platformview... The view is created from the native side in Swift/Objective-c. To debug them you will need to access them, if you would like to debug flutter code instead you just need to run it from AS or VSCode.. You can't debug both of them.. You can place some print on the flutter side, but that's it, i'm sorry – Lorenzo Imperatrice Apr 15 '20 at 15:08
-
thank you. But I think may be it has some way to debug both of them. Let us discuss in the coming todays if I find a solution. – zhouxinle Apr 15 '20 at 15:13
-
No worry, anyways I'm pretty sure there isn't unfortunately – Lorenzo Imperatrice Apr 15 '20 at 15:31
-
I read the flutter official documents. It says Andriod can debug. But iOS didn't mention. – zhouxinle Apr 16 '20 at 02:22