I have an Ionic app that I can run and debug using the Ripple emulator launched from Visual Studio 2015.
I can also run it on my Android device if I "Start without debugging".
Unfortunately, something that works on the emulator doesn't work on the device, so I need to debug on the device.
This is where I start hitting problems. Visual Studio hangs at "Installing app on device..." - unless I uninstall the app that was installed when I ran without debugging.
When I do that, the app runs but it doesn't hit any breakpoints and Visual Studio stops responding. After "LAUNCH SUCCESS" I have this message:
Command finished with error code 0: cmd /s /c
""C:.....\android\cordova\run.bat --nobuild --device --debug
So...how to get debugging working on the device?
Have you tryied with chrome inspector? Plug your phone with the app installed, open it, open your chrome and type in the nav bar chrome://inspect
Like Del mentioned earlier, you can use Chrome and type chrome://inspect
in the navigation bar to debug your app via USB.
Make sure your device has Enable Remote Debugging enabled in the developer tools.
But I also suggest you try emulating a mobile device with a tool like thee Ripple Emulator extension for Chrome, which provides additional mobile feature simulation like:
- Touch events
- User agent
- Geo-location spoofing (with GPS delay & failure events)
- Accelerator spoofing
- Etc.
There are other tools that provide similar functionality.
These do of course work with Cordova apps as you mentioned in a comment.
Finally, if you are willing to buy an tool, I can suggest you try Telerik's AppBuilder plugin for Visual Studio. This tool allows you to deploy your app and debug it through Visual Studio. The debug interface looks similar to that of Chrome, where you can view your Console, Resources, Network, Timeline and Elements.
To fix this, I put the following line of code in the .js file right before the line of code that I have placed the breakpoint. This seems to give the application to stop for a moment and see the breakpoint.
alert("put whatever you want in here");
I hope this helps you as well.