locked
Can't debug on iPhone RRS feed

  • Question

  • User146741 posted

    Hello

    I am trying to debug my application on iPhone (debugging on iPhone simulator works fine, but is not enough since I want to debug remote notifications).

    I have my project configuration options set as follows: Configuration: Debug Platform: iPhone Enable Debugging: true Enable incremental builds: tried both true and false Enable Profiling: true Enable Device Specific builds : tried both true and false Build ad-hoc/enterprise package: true iOS Debugging: Enable Debugging: true Debugger Port: 10000 Debug over WiFi: true iOS Bundle Signing Identity: Distribution (Automatic) Provisioning profile: Automatic

    With the Xamarin MAC agent connected, I can see my phone in the device list. When I click the play button next to my phone's name to start debugging the build start, and I get the following message:

    Please Start the Application The application has been built and uploaded, or is already up to date.

    Visual Studio cannot start the application automatically because it was signed with a Distribution provisioning profile. Please start it by tapping the application icon on the device.

    This message is wrong because the actually deployment does NOT start until I click "OK" to dismiss this modal message. The icon for my app does not appear until I dismiss this message, then I see in Visual Studio status bar that the application is being deployed then successfully deployed.

    When the deployment succeeds, I tap my app's icon, I see the splash screen for my app, the phone asks me if I want to enable notifications (if it was not already installed) then the app crashes. Nothing happens in visual studio.

    I checked the page: https://developer.xamarin.com/guides/ios/deployment,testing,andmetrics/debugginginxamarinios/ it said add -v -v -v to additional mtouch arguments, so I did that But still didn't see any helpful information in Device Log

    Any help would be greatly appreciated. Thanks a lot in advance.

    Monday, May 1, 2017 7:15 AM

Answers

  • User146741 posted

    Solved after 4 hours of troubleshooting. I will put a solution here in case someone encounters the same problem.

    My problem turned out to be that I was signing the app with a distribution certificate and using an Ad-Hoc provisioning profile. Switching to development certificate would result in the error: No installed provisioning profiles match the installed iOS code signing keys

    To solve that error, on my Mac I opened XCode, created a new blank iOS project. In the project properties I selected my account as "Team" and started debugging on my iphone, xcode would automatically generate the missing provisioning profile.

    Now back to visual studio 2017 on my Windows machine, I change try to debug again and it launched without a problem and debugger is attached, and would stop at breakpoints making me a happy :)

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, May 1, 2017 9:19 AM

All replies

  • User146741 posted

    Solved after 4 hours of troubleshooting. I will put a solution here in case someone encounters the same problem.

    My problem turned out to be that I was signing the app with a distribution certificate and using an Ad-Hoc provisioning profile. Switching to development certificate would result in the error: No installed provisioning profiles match the installed iOS code signing keys

    To solve that error, on my Mac I opened XCode, created a new blank iOS project. In the project properties I selected my account as "Team" and started debugging on my iphone, xcode would automatically generate the missing provisioning profile.

    Now back to visual studio 2017 on my Windows machine, I change try to debug again and it launched without a problem and debugger is attached, and would stop at breakpoints making me a happy :)

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, May 1, 2017 9:19 AM
  • User329862 posted

    sure, it's successful after using development certificate instead of distribution certificate. Thank you very much

    Monday, September 4, 2017 9:47 AM
  • User22946 posted

    Thx you saved my day :-)

    Thursday, October 26, 2017 8:25 AM
  • User335057 posted

    Thks !

    Tuesday, November 28, 2017 4:24 PM
  • User275340 posted

    Non of the above solutions worked for me, after trying all of them I wasn't able to debug on a device. What solve my problem was to open the iOS .csproj file and under the PropertyGroup for 'Debug|Iphone' change the value of from True To False then reload the project. That did the trick!!

    Wednesday, March 7, 2018 9:56 PM
  • User326854 posted

    Same error all the time :( we can't debug application on iPhone device just for testing !! need help

    Sunday, August 5, 2018 7:33 PM
  • User72117 posted

    I find that is I uncheck debug as Wifi on the Mac and then re-enable it it refreshes.

    Friday, March 15, 2019 8:23 PM