Unable to open Smart TV app in debugger mode
I want to debug the same Smart app using web inspector. In web inspector, the entire HTML DOM of the app can be seen in Google chrome window.
When I am trying to open the app in web inspector, I am getting the following error.
automatic connection failed. Failed to connect to remote server of web inspector. Please run chrome browser manually and connect the http://localhost:8888
I have also installed the apache 2.2 server.
When I try to run "localhost:8888" in google chrome, it gives "page not found error".
Please help if anyone knows the solution for this
The web inspector is a web server running inside the emulator VM so if you're trying to access it from the host OS, you'll need to change the network config. In VirtualBox, the network uses NAT with a subnet 10.0.2.x by default. This prevents incoming connections (ie. host to guest) but allows outgoing (ie. guest to host).
" connecting to a web server running in the Guest. This is not (normally) possible using NAT mode as there is no route into the Guest OS" - networking in VirtualBox
This is a crude fix but hopefully it'll spur someone else to find something better.
- In VirtualBox, select the emulator and choose network on the right
- Change 'Attached to' from NAT to bridged adapter and under Name, choose the interface with network access. This is equivalent to attaching another physical device to the network.
- Run debug mode and wait for the VM to load
- Hover over the 2 monitor icon in the bottom right of VirtualBox. Amongst the network config, there will be an IP address. Make note of it.
On the browser, go to http://x.x.x.x:8888 where x.x.x.x is the IP from step 4. It will still say can't load, but the link will change to something longer. Replace localhost with the IP and it should load now.
I had issues with this as well, but ultimately found that installing the latest VirtualBox SmartTV VM, triple checking the emulator connections within Edge, and adding 'Chrome Dev Tools' debugging feature as a new item through 'Preferences' >> 'Install/Update' >> 'Available Software Sites' did the trick.
For a detailed explanation of that last bit, check out this video: