{"id":8744,"date":"2015-05-06T13:40:00","date_gmt":"2015-05-06T13:40:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/05\/06\/using-fiddler-to-monitor-network-traffic-from-the-vs-emulator-for-android\/"},"modified":"2022-07-31T23:55:03","modified_gmt":"2022-08-01T07:55:03","slug":"using-fiddler-to-monitor-network-traffic-from-the-vs-emulator-for-android","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/using-fiddler-to-monitor-network-traffic-from-the-vs-emulator-for-android\/","title":{"rendered":"Using Fiddler to monitor network traffic from the VS Emulator for Android"},"content":{"rendered":"<div>\n  In today\u2019s cloud-connected world, it\u2019s hard to find an app that doesn\u2019t make use of an internet connection in some way or another. Whether you\u2019re collecting app usage telemetry, making calls to a web service, or uploading your users\u2019 cat pictures to Facebook, ensuring that your app can reliably communicate with the web is critical to developing a high quality product.\n<\/div>\n<div>\n  You already know that the <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/12\/introducing-visual-studio-s-emulator-for-android.aspx\">Visual Studio Emulator for Android<\/a> provides a great experience for debugging and testing your C++, JavaScript\/TypeScript and HTML, C#, and even Java code on Android, but did you know that with network monitoring utilities such as Fiddler you can also monitor inbound and outbound traffic from your app while it runs on the emulator? In this blog post, I\u2019ll review just how easy it is to get set up to monitor network traffic across the emulator.\n<\/div>\n<h2>Step One: Install the latest versions of the emulator and Fiddler<\/h2>\n<div>\n  Network monitoring is only possible with versions of the emulator greater than or equal to 50427.1. To figure out which version of the emulator you are running, go to Add\/Remove Programs and look for the \u201cMicrosoft Visual Studio Emulator for Android\u201d entry.\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/5684.networkmon-arp.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/5684.networkmon-arp.png\" alt=\"\" border=\"0\" \/><\/a>\n<\/div>\n<div>\n  If you don\u2019t have the latest version, <a href=\"https:\/\/aka.ms\/blogdownloadvsemu\" target=\"_blank\" rel=\"noopener\">visit our homepage to install it<\/a>.\n<\/div>\n<div>\n  Once you have the emulator installed, download and install <a href=\"http:\/\/www.telerik.com\/download\/fiddler\">Fiddler (for .NET 4)<\/a>.\n<\/div>\n<div>\n  Now you\u2019re ready to get started configuring the emulator to proxy network traffic through Fiddler.\n<\/div>\n<h2>Step Two: Configure Fiddler<\/h2>\n<div>\n  Open Fiddler and go to Tools > Fiddler Options. Under the \u201cConnections\u201d tab:\n<\/div>\n<ul>\n<li>Check \u201cAllow remote computers to connect\u201d<\/li>\n<li>Check \u201cReuse client connections\u201d<\/li>\n<li>Check \u201cReuse server connections\u201d<\/li>\n<li>Check \u201cMonitor all connections\u201d<\/li>\n<li>If you want to view traffic from both the emulator and your host PC, check \u201cAct as system proxy on startup\u201d<\/li>\n<li>Write down the port listed under \u201cFiddler listens on port\u201d (the default is 8888).<\/li>\n<\/ul>\n<div>\n  Your Connections tab should now look something like this:\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/0336.networkmon-fidopts.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/0336.networkmon-fidopts.png\" alt=\"\" border=\"0\" \/><\/a>\n<\/div>\n<div>\n  Hit \u201cOK.\u201d Now hover over the <em>Online<\/em> indicator in the top right of the Fiddler window, and record the last IP address listed\u2014this is the IP address that will be visible to the emulator. For example, in the screenshot below, my IP address is 10.82.33.138.\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/4643.networkmon-fidip.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/4643.networkmon-fidip.png\" alt=\"\" width=\"398\" \/><\/a>\n<\/div>\n<div>\n  Now,<strong> close Fiddler<\/strong>. This is an important step\u2014if Fiddler is running when you start the emulator, it will interfere with the emulator\u2019s startup processes and prevent the emulator from starting.\n<\/div>\n<h2>Step Three: Configure the emulator<\/h2>\n<div>\n  With Fiddler closed, start your emulator. You can start the emulator by either hitting F5 in a Visual Studio Cross-Platform project type (VC++, Cordova, or Xamarin), or by pressing the play button in the Emulator Manager, available in Visual Studio 2015 under the Tools > \u201cVisual Studio Emulator for Android\u2026\u201d option.\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/0045.networkmon-tools.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/0045.networkmon-tools.png\" alt=\"\" width=\"500\" \/><\/a>\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/8420.networkmon-emumgr.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/8420.networkmon-emumgr.png\" alt=\"\" border=\"0\" \/><\/a>\n<\/div>\n<div style=\"text-align: left\">\n  Once the emulator is running, in Android hit the Launcher button, go to the Settings app, and open WiFi settings. Now, click and hold on the WiFi network that appears (should be \u201cWired eth1\u201d). A dialog will appear like this:\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/3603.networkmon-modnet.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/3603.networkmon-modnet.png\" alt=\"\" width=\"415\" \/><\/a>\n<\/div>\n<div style=\"text-align: left\">\n  Click \u201cModify network\u201d then check \u201cAdvanced options.\u201d If you accidentally click \u201cForget network,\u201d you\u2019ll need to reboot the emulator for it to find the simulated WiFi network again. Now, set the Proxy dropdown to \u201cManual.\u201d\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/6471.networkmon-advnet.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/6471.networkmon-advnet.png\" alt=\"\" width=\"405\" \/><\/a>\n<\/div>\n<div style=\"text-align: left\">\n  Fill in the \u201cProxy hostname\u201d textbox with the IP address you wrote down from Fiddler above and the \u201cProxy port\u201d textbox with the port you wrote down from Fiddler Options > Connections tab (\u201cFiddler listens on port\u201d).\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/2783.networkmon-savenet.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/2783.networkmon-savenet.png\" alt=\"\" width=\"404\" \/><\/a>\n<\/div>\n<div style=\"text-align: left\">\n  Click \u201cSave.\u201d\n<\/div>\n<h2>Step Four: Enjoy monitoring network traffic of your app running in the emulator<\/h2>\n<div>\n  Now, reopen Fiddler and you are ready to go! Note that if Fiddler does not have an exception\/allowance to run through your firewall, you will first need to create one&#8211;otherwise Fiddler will not be able to receive messages and the emulator will appear to be unable to connect to the internet.\n<\/div>\n<div style=\"text-align: center\">\n  <a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/8117.networkmon-fidwork.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/05\/8117.networkmon-fidwork.png\" alt=\"\" border=\"0\" \/><\/a>\n<\/div>\n<div>\n  If you have HTTPS traffic decryption on (under the HTTPS tab in Fiddler Options), Android will display a certificate warning.\n<\/div>\n<div>\n  I hope that this helps you get up and running with monitoring network traffic using the Visual Studio Emulator for Android. If you have any additional questions or suggestions, feel free to drop me a line in the comments below or <a href=\"http:\/\/stackoverflow.com\/questions\/tagged\/android-emulator\">ask us questions on StackOverflow<\/a>!\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In today\u2019s cloud-connected world, it\u2019s hard to find an app that doesn\u2019t make use of an internet connection in some way or another. Whether you\u2019re collecting app usage telemetry, making calls to a web service, or uploading your users\u2019 cat pictures to Facebook, ensuring that your app can reliably communicate with the web is critical [&hellip;]<\/p>\n","protected":false},"author":164,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-8744","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>In today\u2019s cloud-connected world, it\u2019s hard to find an app that doesn\u2019t make use of an internet connection in some way or another. Whether you\u2019re collecting app usage telemetry, making calls to a web service, or uploading your users\u2019 cat pictures to Facebook, ensuring that your app can reliably communicate with the web is critical [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/8744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/164"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=8744"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/8744\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=8744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=8744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=8744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}