Debugging your Visual Project on Andriod or Iphone

Debugging your Visual Project on Andriod or Iphone

At times you may need to bind your Visual Studio Project to a Ip address. One good reasons why you may need to this is, say for example you need to view your responsive web sites on a Andriod or Iphone. Having your visual project on a Ip address you can easily access your project in Andriod using a Chrome or Iphone Safari.

Briefly are the steps to change from localhost to 192.168.1.11 on port 5665 Ip address:-

  1. Open your Applicationhost.config File locate at following address C:\Users\jkanimea\Documents\IISExpress\config\Applicationhost.config
    • Note as of VisualStudio 2015 it now located in /{project folder}/.vs/config/applicationhost.config
  2. Find in the Applicationhost.config the localhost i.e. Edit the binding *:5665:localhost —> *:5665:192.168.1.11
  3. Go to the cmd prompt as administrator and type the following “netsh http add urlacl url=http://192.168.1.11:5665/ user=everyone”
  4. Add this to firewall –> netsh advfirewall firewall add rule name=”IISExpressWeb” dir=in protocol=tcp localport=1234 profile=private remoteip=localsubnet action=allow
  5. On visual Project –> Right click on the project and change Project URL from localhost:5665 —> 192.168.1.11:5665
    or u change the MDT.Client.csproj —> change the localhost to 192.168.1.11
  6. Run your project and it should start as 192.168.1.11:5665
  7. After doing this you can go to Andriod on Chrome or Iphone on Safari and access your project using http://192.168.1.11:5665

Another Options to debug your Visual Studio Project on Andriod Phone is via USB

  1. Setting up Computer
    • You need to install Andriod SDK on your window Pc, You can follow this link
  2. Setting up Andriod Phone
    • Goto setting -> Developer options
    • Under Debugging –> choose USB debugging
    • Open Chrome browser
    • Connect your Andriod phone on a usb
  3. Go to command prompt on your Computer type adb usb –> you get something like this
    • C:\Users\jkanimea>adb usb
      * daemon not running. starting it now on port 5037 *
      * daemon started successfully *
  4. On the Chrome URL type Chrome:inspect –> you see your andriod phone detected
  5. Click on the Port forwarding and add localhost 5037
  6. Click on the inspect you get the following screen
    • Chrome Debug
  7. Click on the inspect, you should get the following screen
    • Chromedebug02You can than debug or inspect any element on your Iphone

 

For Iphone there also a options to debug your Visual Studio Project  via USB

  1. You need install Telerik AppBuilder. You can follow the instruction in this link
  2. Also need to install itunes for Iphone to be detected
  3. Create a sample project and click on the debug

Leave a Reply

Your email address will not be published. Required fields are marked *