3

i want to Debug some Networkproblem cases in my Application. But i can't really test it because my Phone has internet over USB. If I disconnect it from USB i can't debug... So is there anyway, I can disable the Tethering over USB on my Phone?

Edit: I have a HTC Trophy but it's the same with the Lumia 800 of my friend...

MrTouch
  • 654
  • 2
  • 12
  • 28
  • How did you disable Zune, to allow for Internet Sharing over USB? – Rowland Shaw May 16 '12 at 07:39
  • Actually i did nothing.. Zune is always running in the Background... I can't debugg without Zune Running in the Background... – MrTouch May 16 '12 at 07:41
  • Are you saying the PC is getting internet from phone, or vice-versa? – Rowland Shaw May 16 '12 at 07:50
  • 1
    no the phone is getting internet from the pc. but i dont want this. i have to test this: "what happens to my stream(on the phone) if the phone looses internet connection?" but i cant debug this because the phone is always getting internet from my pc. – MrTouch May 16 '12 at 08:11

2 Answers2

3

Assuming that you're connecting to a web service which isn't running on your machine, you can test this by disconnecting your PC from any network which gives it access to the internet (i.e. turn off wifi on the pc or pull the network cable.)

It's not an elegant solution or one that can be easily automated but it works. ;) (I used this method with testing an app which would progressively download large files in pieces and would stop and then resume as connectivity was lost and restored.)

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • lol, why didn't i thought of this? and yes not really elegant but this should work. (But it really is annoying that i can't just disable this function...) – MrTouch May 16 '12 at 08:13
  • yeah, I'm disabling LAN in "Network Connections". Saves me trip under the desk. But no browsing and IMs still sucks. – Agent_L May 16 '12 at 15:13
1

You also can use Fiddler http://www.fiddler2.com/fiddler2/ as a Proxy for your emulator to simulate lossy connections or no connection at all. This way you can still surf and look for references while you code :-)

edit: fiddler doesnt seem to work for the Emulator(for more information, look into the comments), but if you want to simulate a lossy Connection then this is the way to go, even work for phones with the connection-cable.

kadir
  • 1,417
  • 11
  • 35
  • 3
    Microsoft explicitly stated that windows phone emulator does NOT work with Fiddler. http://msdn.microsoft.com/en-us/library/ff754351%28v=vs.92%29.aspx#BKMK_fiddler If you think they're wrong and you're right, then tell us how to make it work. – Agent_L May 16 '12 at 11:26
  • Oh that I didnt know, I for myself use the Network Emulator Toolkit(http://blog.mrpol.nl/2010/01/14/network-emulator-toolkit/), which works fine :-) I wanted to switch to Fiddler, because it doesnt affect the whole connection, but that seems outdated now. Thanks for the Info – kadir May 16 '12 at 12:06
  • Fiddler works fine with Windows Phone emulator. The Windows Phone team stupidly hosted their debug bridge on port 8888 (stealing all traffic from Fiddler). You can simply move Fiddler to a different port or set the `proxyregistrationhostname` preference. – EricLaw Mar 18 '14 at 18:33