-
Notifications
You must be signed in to change notification settings - Fork 311
Debugging the App
This is by far the fastest method for debugging the desktop app. It will require that you install the electron module to your system, npm install -g electron
.
In order to run the electron command you need to have completed 2 tasks beforehand:
- Copy the package.json from
phonegap-app-desktop/src/config/
tophonegap-app-desktop/www/
- Run
npm install
insidephonegap-app-desktop/www/
Once you have done this you can run the app using electron www/
from the root directory or electron .
if you are inside the www directory. This will launch desktop app in a new electron window along with the developer tools console. If the app launches without the developer console, check that in the package.json the option for devTools is set to true:
"window" : {
"devTools" : true
},
If you want to debug a particular node module you can edit them from phonegap-app-desktop/www/node_modules/
. In order for the new changes to take affect you will need to refresh the desktop app. You can do this by going to the developer console and pressing Cmd-R
if on OS X or Ctl-R
if on Windows. Any debug statements that you added should now be visible in the developer console.
This method is a little slower but will take care of the manual steps that are required when using the electron command. You will need to install the grunt CLi using npm install -g grunt
. From the project root just run the command grunt
and this will build and package the desktop app.
When this has finished the app will be located in phonegap-app-desktop/build/PhoneGap-<platform>/
folder. To run the app on OS X double click PhoneGap.app
and on Windows double click PhoneGap.exe
. This will launch the desktop app with the developer tools console. If you are working on Windows, follow the instructions in phonegap-app-desktop/INSTALL
to install the necessary dependencies.
Using grunt you can only edit the node modules if you are working on OS X. To do this edit the particular module you want from phonegap-app-desktop/build/PhoneGap-darwin-x64/PhoneGap.app/Contents/Resources/app/node_modules/
and refresh the desktop app.