Is anyway to debug from windows Vs directly to Iphone and hit breakpoint.

I am new for xamarin.

I have windows machine run Visual studio 2017 ,with a xamarin form program.

I also have a mac machine and with a device iPhone connect to mac.

I noticed if I set breakpoint in program, and run in iPhone.

program will run ,but breakpoint will not be hit.

If I run in ios simulator, this breakpoint will be hit.

regards
yang

Posts

  • prashantvcprashantvc USXamarin Team Xamurai

    You should be able to debug an app on the device.
    What build configuration are you using? Could you make sure that you're able to hit the breakpoint in Visual Studio for Mac?

  • wulongyangwulongyang USMember ✭✭

    I mean from windows machines (vs 2017 ) to debug IPhone( which link to MAC machine).
    I can not hit breakpoint .

  • prashantvcprashantvc USXamarin Team Xamurai

    I understand that, wanted to make sure that you're able to hit the breakpoints on the Mac.

    Could you try clean all and rebuild the project? Let us know if that helps

  • wulongyangwulongyang USMember ✭✭

    hi,Prashantvc:

    I have tried clean all and rebuild project, still not work.

    1.from my windows 10 machine, I run vs 2017, I can not hit breakpoint in iPhone(real device), which link to my mac.
    2.from my windows 10 machine, I run vs 2017, I can hit breakpoint in iPhone simulator .
    3.from my Mac machine, I run vs 2017, I can hit breakpoint in iPhone (real device) .
    4 .from my Mac machine, I run vs 2017, I can hit breakpoint in iPhone simulator .

    only the first scenario, not work.

    any idea?

  • ErdegaErdega USMember

    Hello all,

    even if an old thread: I have the same problem - but also a solution which at least works for me.

    Problem:
    1. Setup: Windows 10 with VS2017, Mac-Book, iPhone connected to Mac-Book.
    2. Debug-Log / Breakpoint-Hitting seams to work sometimes (seldom) / non deterministic.

    Solution:
    1. Verify: In case no Debug-Log occurs (e.g. no "Loaded assembly:..." lines etc.) the "Choose Device" drop-down box in the "Tools >> iOS >> Device Log" window shows TWO times the name of the iOS-device.
    2. Stop the debug and explicitly stop the app on the iOS-device (if necessary also delete it for re-deploy)
    3. Via "Tools >> iOS >> Xamarin Agent" disconnect from your Mac and then reconnect again.
    4. Verify: the "Choose Device" drop-down in the "Tools >> iOS >> Device Log" window now shows only ONE times the name of the iOS-device.
    5. Debug the App - it now should work.

    Best Regards
    TM

    P.S.: If this solution works for you it would be nice to leave a comment so Xamarin could try again to fix this problem.

  • _Jai_Jai USMember ✭✭

    @prashantvc said:
    You should be able to debug an app on the device.
    What build configuration are you using? Could you make sure that you're able to hit the breakpoint in Visual Studio for Mac?

    its getting hit for simulator but not for iphone ...... can you help me?

Sign In or Register to comment.