Search code examples
proxyios-simulatorxamarin.formsfiddler

Fiddler - Xamarin Forms - Local Azure Backend - iOS simulator


I've got:

  • a PC and mac linked through Xamarin in VS2015
  • fiddler running on the PC
  • a local azure backend running on the pc
  • the mac http proxy is setup to fiddler ip (my pc ip) and port (8888)

I'm debugging a Xamarin Forms app on Xamarin iOS Simulator on PC.

When I browse in safari within Xamarin iOS Simulator, Fiddler captures it. However, when my app makes some requests to my local backend (HTTP not HTTPS) I don't see them. If I run the app in a Windows simulator, the requests are captured.

Am I missing a step?


Solution

  • I can now use Fiddler with Azure mobile app, Xamarin and ios tks to @user6581605 as well as this post: https://shellmonger.com/2016/06/23/using-modernhttpclient-with-azure-mobile-apps/

    I installed the modernhttpclient nuget from Paul Betts : https://www.nuget.org/packages/modernhttpclient/

    Then I instanciate my MobilerServiceClient this way:

    var client = new MobileServiceClient("https://mysite.azurewebsites.net",
        new ModernHttpClient.NativeMessageHandler());
    

    To finish update info.plist with

    <key>NSAppTransportSecurity</key>
        <dict>
            <key>NSAllowsArbitraryLoads</key>
            <true/>
            <key>NSExceptionDomains</key>
            <dict>
                <key>yourdomain.com</key>
                <dict>
                    <key>NSIncludesSubdomains</key>
                    <true/>
                    <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                    <false/>
                </dict>
           </dict>
      </dict>