Book Image

PhoneGap 4 Mobile Application Development Cookbook

Book Image

PhoneGap 4 Mobile Application Development Cookbook

Overview of this book

Table of Contents (19 chapters)
PhoneGap 4 Mobile Application Development Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Debugging the iOS Cordova application using Safari Web Inspector


Debugging iOS Cordova can be done just like debugging a normal web application. We can catch network activities, inspect elements, and see the console logging.

How to do it…

To start debugging a iOS Cordova application, follow these steps:

  1. Open and run the HelloWorld project created before using Xcode.

  2. While the application is running on the simulator, open Safari. Go to Develop | iOS Simulator | index.html, as shown in the following screenshot:

  3. We can inspect the element and check out Local Storage and Session Storage by choosing the Resources tab, as follows:

  4. We can see the network activities on the Timelines tab, as shown in this screenshot:

  5. To see the output on the browser's JavaScript console, click on the Console tab.

How it works…

We opened the iOS Cordova application in Xcode. Then we ran the application on a simulator. While the application was being run on the simulator, we opened Safari and chose Web Inspector. Safari connects...