Sunday, February 21, 2016

Debugging Phonegap Apps on Emulators

Just recently started developing Mobile Apps and the start was with the Hybrid Apps using Phonegap.

Straight away I hit the roadblock as there were a lot of JS Errors. I could see that there were errors but unlike a web app, I did not have the luxury to hit F12 and open up the console to watch for all the errors in the console of the Chrome.

So what to do ???

Here is the answer...

1. Open CHROME on your desktop.
2. Navigate to "chrome://inspect"
3.  Check the Box "Discover USB Devices"

This would show a list of all the available Devices, including the emulators also.

Click on INSPECT for any device that you need and viola !! You have the console showing all errors for your device/emulator.


Hope this helps someone.


Thanks
Ashutosh

Saturday, February 20, 2016

Config.xml not found by Visual Studio Debugger (Ripple)

At times, while developing hybrid apps using HTML5 and JS with Apache Cordova tools for visual studio, we face this issue when the Visual Studio debugger is unable to find the config.xml file.

The reason for this is that visual studio wants this file to be present at the root of the project where as PhoneGap wants this to be at the root folder of the web app (WWW folder in visual studio project).

The solution to this is simply copying the file over from the original location to the WWW folder.

This could also be done by adding the below tag to the JSProj file.


1
2
3
<target name="AfterBuild">
    <copy continueonerror="false" destinationfolder="www" sourcefiles="config.xml"></copy>
</target>





Hope this helps.