ponydebugger

About PonyDebugger

PonyDebugger is a powerful network debugging tool for iOS apps. It allows developers to debug network traffic, CoreData, CoreAnimation, and more with an easy-to-use user interface. This open-source project provides real-time, remote debugging capabilities for iOS devices. With PonyDebugger, developers can gain valuable insights into their app’s behavior during runtime.

Key Features

  • Real-time network traffic monitoring and inspecting
  • View and edit CoreData databases on the device
  • Debug JavaScript from within native iOS apps
  • Inspect CoreAnimation layers and properties
  • Remote logging for debugging in production environments

Getting Started

To use PonyDebugger in your iOS app, follow these steps:

Step 1: Installation

Install PonyDebugger via CocoaPods by adding the following line to your Podfile:



pod "PonyDebugger"

Then, run pod install to fetch the dependencies and set up the Xcode workspace.

Step 2: Integration

Open your Xcode project workspace, and import the necessary files:



#import

Initialize PonyDebugger in your app delegate’s didFinishLaunchingWithOptions method:



[[PDDebugger defaultInstance] enableNetworkTrafficDebugging];
[[PDDebugger defaultInstance] forwardAllNetworkTraffic];
[[PDDebugger defaultInstance] enableCoreDataDebugging];
[[PDDebugger defaultInstance] addManagedObjectContext:self.managedObjectContext withName:@"My ManagedObjectContext"];
[[PDDebugger defaultInstance] runDebugger];

Usage

PonyDebugger offers various ways to view and inspect your app’s data:

Network Traffic

To monitor network traffic, use the PonyDebugger user interface in the browser:



http://localhost:9000

This interface provides detailed information about the API requests and responses, including headers, payloads, and response times.

CoreData

Inspecting and modifying CoreData databases within the app becomes easy with PonyDebugger. Utilize the CoreData user interface at the following address:



http://localhost:9000/ponydata/

This interface allows you to query, delete, and modify CoreData objects directly from the browser.

JavaScript Debugging

PonyDebugger enables debugging of JavaScript code running within native iOS apps. Use the Safari Web Inspector on the following address to debug JavaScript:



http://localhost:9000/ponyjavascript/

Note that this requires Safari 6.1+ on your development machine. You will also need to enable the developer menu in the desktop Safari preferences.

CoreAnimation

Inspecting CoreAnimation layers and their properties can be done through the following address:



http://localhost:9000/ponylayer/

The user interface allows you to examine and modify CoreAnimation properties, layer hierarchy, and animations.

Remote Logging

PonyDebugger supports remote logging, enabling debugging in production environments. You can view logs in real time via the browser interface at:



http://localhost:9000/pd/log/

Logs can be filtered and searched for easier debugging.

Contributing

If you’d like to contribute to PonyDebugger, follow these steps:

Step 1: Fork the project

Fork the PonyDebugger repository on GitHub:



https://github.com/square/PonyDebugger/fork

Step 2: Make your changes

Create a new branch for your changes and start making modifications.

Step 3: Submit a pull request

Once you’ve made your changes, push your branch to your forked repository and submit a pull request to the main PonyDebugger project.

License

PonyDebugger is released under the Apache License 2.0. For more details, please refer to the LICENSE file in the project repository.