peez80
peez80

Reputation: 1643

Debugging PhoneGap on Device

Normally I'm a JEE guy but these days I'm working on a mobile app. I chose PhoneGap because there are not so many needs to UI and I thought this would be the easiest way to serve the app on many platforms.

I'm wondering if my setup is good and if it's possible to get console output when running on the device. I'm working on MacOS and iPhone6.

I installed PhoneGap and Cordova via npm and serving the files with phonegap serve.

For local debugging I'm using the chrome plugin "Ripple".

For debugging on the device I'm using the PhoneGap Developer App from the AppStore, together with weinre on my Laptop to get some debugging data. In weinre I can see everything except console outputs. Is this normal? Or any idea how I could get the console to weinre, too?

I also found some tutorials on the web using XCode and some native iPhone emulator but didn't get this working yet. Which way is the more preferable way of debugging on device?

Upvotes: 0

Views: 104

Answers (2)

Mitul Verma
Mitul Verma

Reputation: 237

You don't need any tool for debugging cordova app. For iOS just start the app in stimulator and start safari. In safari go to Develop > 'your pc name' > ios simulator.

http://webdesign.tutsplus.com/articles/quick-tip-using-web-inspector-to-debug-mobile-safari--webdesign-8787

For Android run the app in your device and in the chrome go to http://chrome://inspect/#devices

Upvotes: 1

Raymond Camden
Raymond Camden

Reputation: 10857

Weinre is quite old and should not be be used anymore, instead, you want to use the remote debugging tools in your browser. For iOS, you can use Safari to debug your Cordova app. I've got a full article here, https://dzone.com/articles/overview-mobile-debugging, but the process involves doing one setting on your mobile device, and then simply opening up Safari and going to the debug menu. You can also do this with Chrome and Android apps.

Another option is GapDebug (https://www.genuitec.com/products/gapdebug/) which lets you do iOS and Android together in one Chrome tab.

Upvotes: 0

Related Questions