Git Product home page Git Product logo

ponydebugger's Introduction

PonyDebugger Logo

PonyDebugger

CI Status Version License Platform

PonyDebugger is a remote debugging toolset. It is a client library and gateway server combination that uses Chrome Developer Tools on your browser to debug your application's network traffic and managed object contexts.

To use PonyDebugger, you must implement the client in your application and connect it to the gateway server. There is currently an iOS client and the gateway server.

PonyDebugger is licensed under the Apache Licence, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).

Changes

v0.4.0 - 2014-08-15

  • Support NSURLSession requests for the Network Debugger. (@viteinfinite)
  • New test application that removes the AFNetworking dependency. (@viteinfinite)
  • Remove custom base64 implementation with Apple's built-in implementation. (@kyleve)
  • Add PodSpec for pulling the git repository directly. (@wlue)

v0.3.1 - 2014-01-02

  • Fix only building active arch in debug. (@kyleve)
  • Fix view hierarchy debugging with complex key paths. (@ryanolsonk)
  • Fix crash in swizzled exchangeSubviewAtIndex:withSubviewAtIndex: (@ryanolsonk)
  • Fix for crash when having a library that looks like a NSURLConnectionDelegate (@peterwilli)

v0.3.0 - 2013-05-01

  • Remote Logging and Introspection (@wlue)
  • Request response pretty printing in Network Debugger (@davidapgar)
  • Minor bug fixes and improvements. (@jerryhjones, @conradev, @ryanolsonk)

v0.2.1-beta1 - 2013-01-12

  • Bonjour support (@jeanregisser)
  • Memory leak fix (@rwickliffe)

Features

Network Traffic Debugging

PonyDebugger sends your application's network traffic through ponyd, PonyDebugger's proxy server. You use Inspector's Network tools to debug network traffic like how you would debug network traffic on a website in Google Chrome.

PonyDebugger Network Debugging Screenshot

PonyDebugger forwards network traffic, and does not sniff network traffic. This means that traffic sent over a secure protocol (https) is debuggable.

Currently, the iOS client automatically proxies data that is sent via NSURLConnection and NSURLSession methods. This means that it will automatically work with AFNetworking, and other libraries that use NSURLConnection or NSURLSession for network requests.

Core Data Browser

The Core Data browsing feature allows you to register your application's NSManagedObjectContexts and browse all of its entities and managed objects. You browse data from the IndexedDB section in the Resource tab in Chrome Developer Tools.

PonyDebugger Core Data Browser Screenshot

These are read-only stores at the moment. There are plans to implement data mutation in a future release.

View Hierarchy Debugging

PonyDebugger displays your application's view hierarchy in the Elements tab of the Chrome Developer Tools. As you move through the XML tree, the corresponding views are highlighted in your app. You can edit the displayed attributes (i.e. frame, alpha, ...) straight from the Elements tab, and you can change which attributes to display by giving PonyDebugger an array of UIView key paths. Deleting a node in the elements panel will remove that node from the view hierarchy. Finally, when a view is highlighted, you can move it or resize it from the app using pan and pinch gestures.

PonyDebugger View Hierarchy Debugging Screenshot

An "inspect" mode can be entered by clicking on the magnifying glass in the lower left corner of the Developer Tools window. In this mode, tapping on a view in the iOS app will select the corresponding node in the elements panel. You can also hold and drag your finger around to see the different views highlighted. When you lift your finger, the highlighted view will be selected in the elements panel.

Currently only a subset of the actions possible from the elements panel have been implemented. There is significant room for continued work and improvement, but the current functionality should prove useful nonetheless.

Remote Logging

PonyDebugger lets you remotely log text and object dumps via the PDLog and PDLogObjects function. This lets you reduce the amount of content being logged in NSLog, while also allowing you to dynamically introspect objects.

PonyDebugger Remote Login Screenshot

Introspected objects can be expanded recursively by property. This means that you don't have to breakpoint and log in GDB or LLDB to introspect an object.

Quick Start

Prerequisite: Xcode's Command Line Tools must be installed from the "Downloads" preference pane.

curl -s https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | \
  python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger

This will install ponyd script to ~/Library/PonyDebugger/bin/ponyd and attempt to symlink /usr/local/bin/ponyd to it. It will also download the latest chrome dev tools source.

Then start the PonyDebugger gateway server

ponyd serve --listen-interface=127.0.0.1

In your browser, navigate to http://localhost:9000. You should see the PonyGateway lobby. Now you need to integrate the client to your application.

For more detailed instructions, check out the gateway server README_ponyd.

PonyDebugger iOS Client

The PonyDebugger iOS client lets you to debug your application's network requests and track your managed object contexts.

Technical

  • Requires iOS 5.0 or above
  • Uses ARC (Automatic Reference Counting).
  • Uses SocketRocket as a WebSocket client.

Installing

CocoaPods

CocoaPods automates 3rd party dependencies in Objective-C.

Install the ruby gem.

$ sudo gem install cocoapods
$ pod setup

Depending on your Ruby installation, you may not have to run as sudo to install the cocoapods gem.

Create a Podfile. You must be running on iOS 5 or above.

platform :ios, '5.0'
pod 'PonyDebugger', '~> 0.4.3'

If you would like to use the latest version of PonyDebugger, point to the Github repository directly.

pod 'PonyDebugger', :git => 'https://github.com/square/PonyDebugger.git'

Install dependencies.

$ pod install

When using CocoaPods, you must open the .xcworkspace file instead of the project file when building your project.

Manual Installation

  • Extract a tarball or zipball of the repository into your project directory. If you prefer, you may also add the project as a submodule. The iOS client uses SocketRocket as a dependency, and it is included as a submodule.
cd /path/to/YourApplication
mkdir Frameworks
git submodule add git://github.com/square/PonyDebugger.git Frameworks/PonyDebugger
git submodule update --init --recursive
  • Add PonyDebugger/PonyDebugger.xcodeproj as a subproject.

PonyDebugger Installing Subproject

  • In your Project Settings, add the PonyDebugger target as a Target Dependency in the Build Phases tab.

PonyDebugger Installing Target Dependencies

  • Link libPonyDebugger.a, libSocketRocket.a, and the Framework dependencies to your project.

PonyDebugger Installing Link Libraries and Frameworks

  • PonyDebugger and SocketRocket take advantage of Objective C's ability to add categories on an object, but this isn't enabled for static libraries by default. To enable this, add the -ObjC flag to the "Other Linker Flags" build setting.

PonyDebugger Installing Other Linker Flags

Framework Dependencies

Your .app must be linked against the following frameworks/dylibs in addition to libPonyDebugger.a and libSocketRocket.a.

  • libicucore.dylib
  • CFNetwork.framework
  • CoreData.framework
  • Security.framework
  • Foundation.framework

Usage

PonyDebugger's main entry points exist in the PDDebugger singleton.

PDDebugger *debugger = [PDDebugger defaultInstance];

To connect automatically to the PonyGateway on your LAN (via Bonjour):

[debugger autoConnect];

Or to open the connection to a specific host, for instance ws://localhost:9000/device:

[debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9000/device"]];

To manually close the connection:

[debugger disconnect];

Network Traffic Debugging

To enable network debugging:

[debugger enableNetworkTrafficDebugging];

PonyDebugger inspects network data by injecting logic into NSURLConnectionDelegate classes. If you want PonyDebugger to automatically find these classes for you:

[debugger forwardAllNetworkTraffic];

This will swizzle methods from private APIs, so you should ensure that this only gets invoked in debug builds. To manually specify delegate classes:

[debugger forwardNetworkTrafficFromDelegateClass:[MyClass class]];

These methods should be invoked before the connection is opened.

Core Data Browser

PonyDebugger also allows you to browse your application's managed objects. First, enable Core Data debugging:

[debugger enableCoreDataDebugging];

To register a managed object context:

[debugger addManagedObjectContext:self.managedObjectContext withName:@"My MOC"];

View Hierarchy Debugging

To enable view hierarchy debugging:

[debugger enableViewHierarchyDebugging];

PonyDebugger will inject logic into UIView add/remove methods to monitor changes in the view hierarchy.

You can also set the attributes you want to see in the elements panel by passing an array of UIView key path strings

[debugger setDisplayedViewAttributeKeyPaths:@[@"frame", @"hidden", @"alpha", @"opaque"]];

PonyDebugger uses KVO to monitor changes in the attributes of all views in the hierarchy, so the information in the elements panel stays fresh.

Remote Logging

To enable remote logging:

[debugger enableRemoteLogging];

Example usage:

PDLog("Hello world!");               // This logs a simple string to the console output.
PDLogObjects(self);                  // This logs an introspectable version of "self" to the console.
PDLogObjects("My object:", object);  // Combination of text and introspectable object.

The repository contains a test application to demonstrate PonyDebugger's capabilities and usage.

Known Issues / Improvements

  • CoreData.framework must be linked, even if you do not use the Core Data browsing functionality.

  • iOS 5.1 and below: In certain cases, -[NSURLConnectionDataDelegate connection:willSendRequest:redirectResponse:] will never get called. PonyDebugger requires this call to know when the request was sent, and will warn you with a workaround that the timestamp is inaccurate.

    To fix the timestamp, make sure that Accept-Encoding HTTP header in your NSURLRequest is not set (by default, iOS will set it to gzip, deflate, which is usually adequate.

    AFNetworking users: if you subclass AFHTTPClient, call [self setDefaultHeader:@"Accept-Encoding" value:nil];.

Contributing

We’re glad you’re interested in PonyDebugger, and we’d love to see where you take it. Please read our contributing guidelines prior to submitting a Pull Request.

Some useful links:

ponydebugger's People

Contributors

alanf avatar davidapgar avatar dfed avatar efirestone avatar felixonmars avatar gr4yscale avatar harleyjcooper avatar jeanregisser avatar jerryhjones avatar justinseanmartin avatar kleinlieu avatar kyleve avatar larrycao avatar lukabratos avatar mikelikespie avatar mortonfox avatar mthole avatar nsillik avatar omnivector avatar peterwilli avatar pnc avatar puls avatar raphaelschaad avatar rwickliffe avatar ryanolsonk avatar streeter avatar vsapsai avatar wlue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ponydebugger's Issues

ARM64 Crash

So I decided to be super cutting-edge and compile my application for arm64, and I'm consistently getting a crash on startup, seemingly originating from PonyDebugger, of which I'm compiling the latest HEAD (67757b4).

lldb bt:

* thread #11: tid = 0xedd4b, 0x00000001986ef9d0 libobjc.A.dylib`objc_msgSend + 16, stop reason = EXC_BAD_ACCESS (code=1, address=0x1a0018010)
    frame #0: 0x00000001986ef9d0 libobjc.A.dylib`objc_msgSend + 16
    frame #1: 0x000000018d287020 Foundation`-[NSConcreteMutableData appendData:] + 88
    frame #2: 0x00000001002d8e60 Cloudsdale-iOS copy`__67+[PDNetworkDomainController injectDidReceiveDataIntoDelegateClass:]_block_invoke_2(.block_descriptor=0x0000000178256a70, slf=0x00000001700ab400, connection=0x000000017800dfa0, data=0x00000001702e2800) + 176 at PDNetworkDomainController.m:340
    frame #3: 0x000000018d286dd4 Foundation`__65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 80
    frame #4: 0x000000018d286cc0 Foundation`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 232
    frame #5: 0x000000018d286bb8 Foundation`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 80
    frame #6: 0x000000018d286fbc Foundation`_NSURLConnectionDidReceiveData + 80
    frame #7: 0x000000018c3c0e68 CFNetwork`___ZN27URLConnectionClient_Classic29_delegate_didReceiveDataArrayEv_block_invoke + 232
    frame #8: 0x000000018c3c0454 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 96
    frame #9: 0x000000018c402160 CFNetwork`___ZNK17CoreSchedulingSet13_performAsyncEPKcU13block_pointerFvvE_block_invoke + 36
    frame #10: 0x000000018c6d9538 CoreFoundation`CFArrayApplyFunction + 68
    frame #11: 0x000000018c33605c CFNetwork`RunloopBlockContext::perform() + 120
    frame #12: 0x000000018c335ef0 CFNetwork`MultiplexerSource::perform() + 288
    frame #13: 0x000000018c335d2c CFNetwork`MultiplexerSource::_perform(void*) + 60
    frame #14: 0x000000018c79b77c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    frame #15: 0x000000018c79aad8 CoreFoundation`__CFRunLoopDoSources0 + 256
    frame #16: 0x000000018c798d70 CoreFoundation`__CFRunLoopRun + 632
    frame #17: 0x000000018c6d9b78 CoreFoundation`CFRunLoopRunSpecific + 452
    frame #18: 0x000000018d2697b4 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 296
    frame #19: 0x000000018d2c736c Foundation`-[NSRunLoop(NSRunLoop) run] + 96
    frame #20: 0x00000001001fa304 Cloudsdale-iOS copy`+[TFURLConnectionOperation _runNetworkThread:] + 172
    frame #21: 0x000000018d350990 Foundation`__NSThread__main__ + 1000
    frame #22: 0x0000000198e5c1b0 libsystem_pthread.dylib`_pthread_body + 168
    frame #23: 0x0000000198e5c108 libsystem_pthread.dylib`_pthread_start + 140

The crash does not occur when running the application in 32-bit mode. The delegate class in this case is the TestFlight SDK's TFURLConnectionOperation. If I disable TestFlight in my app, I get a crash as soon as I do any network operation, except in the injectWillSendRequestIntoDelegateClass: method instead.

Confusing instructions how to download Chrome Developer Tools

Steps to reproduce:

  1. Create virtual environment, e.g. pony_env
  2. Install ponyd in this environment.
  3. Run ponyd serve

Actual result:
The following error message is shown

Error: devtools directory path/to/pony_env/src/devtools does not exist. Use ponydownloader to download a compatible version of Chrome Developer Tools.

Problem:
I don't understand what is ponydownloader and where can I obtain it.

Build Configuration Name breaks integration

I successfully integrated PonyDebugger in my project for the default Debug configuration.
However, we have a few more configurations that pull in different build-settings files (mostly to configure a few pre-processor macros differently for easy switching).

When using one of these configurations (e. g. Debug (xyz)) the headers cannot be found anymore. I tried to fix this by setting these values in the PonyDebugger build configurations (analogous to what RestKit does, which BTW works in my setup):

PRIVATE_HEADERS_FOLDER_PATH = "$(PUBLIC_HEADERS_FOLDER_PATH)/Private";
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = ../../Headers;

This enabled successful compilation. However then the linker complains, and I have not figured out how to resolve that issue:

ld: library not found for -lSocketRocket
clang: error: linker command failed with exit code 1 (use -v to see invocation)

(see full output below)

It seems to be looking for libSocketRocket.a in the wrong place, if I understand this correctly.

How can I fix this issue? Also: Should I create a pull request for the above change, because it seems to improve the situation a bit already?

Full error output
(wrapped for readability)

Ld "/Users/ds/Library/Developer/Xcode/DerivedData/MyProject-gjuonoyeresaysbhbvztuowdvopw/Build/Products/Debug (TEST)-iphonesimulator/MyProject.app/MyProject" normal i386
    cd /Users/ds/MyProject/iOSClient/MyProject
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
    setenv PATH "/Volumes/MBP4711HD/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Volumes/MBP4711HD/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

/Volumes/MBP4711HD/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
    -arch i386
    -isysroot /Volumes/MBP4711HD/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk
     "-L/Users/ds/Library/Developer/Xcode/DerivedData/MyProject-gjuonoyeresaysbhbvztuowdvopw/Build/Products/Debug (TEST)-iphonesimulator"
    -L/Users/ds/MyProject/iOSClient/MyProject/TestflightSDK 
    "-F/Users/ds/Library/Developer/Xcode/DerivedData/MyProject-gjuonoyeresaysbhbvztuowdvopw/Build/Products/Debug (TEST)-iphonesimulator" 
    -filelist "/Users/ds/Library/Developer/Xcode/DerivedData/MyProject-gjuonoyeresaysbhbvztuowdvopw/Build/Intermediates/MyProject.build/Debug (TEST)-iphonesimulator/MyProject.build/Objects-normal/i386/MyProject.LinkFileList"
    -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load -fobjc-arc -fobjc-link-runtime
    -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.0
    -lSocketRocket
    -licucore
    /Users/ds/Library/Developer/Xcode/DerivedData/MyProject-gjuonoyeresaysbhbvztuowdvopw/Build/Products/Release-iphonesimulator/libPonyDebugger.a
    -framework SystemConfiguration
    /Users/ds/Library/Developer/Xcode/DerivedData/MyProject-gjuonoyeresaysbhbvztuowdvopw/Build/Products/Release-iphonesimulator/libRestKit.a
    -framework CFNetwork
    -lxml2
    -framework MobileCoreServices
    -framework Security
    -framework CoreData
    -framework QuartzCore
    -framework CoreGraphics
    -framework UIKit
    -framework Foundation
    -lTestFlight
    -lz
    -o "/Users/ds/Library/Developer/Xcode/DerivedData/MyProject-gjuonoyeresaysbhbvztuowdvopw/Build/Products/Debug (TEST)-iphonesimulator/MyProject.app/MyProject"

Crash With DOM Debugger

@ryanolsonk I just integrated it in our app, but i am having a random crash. It has happened a few times.

I think I am hitting an assertion. Here's the log output.

Oct 26 10:28:05 unknown Square[187] <Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<PDDOMDomainController: 0xf17d570>: An -observeValueForKeyPath:ofObject:change:context: message was received but not handled.
    Key path: frame
    Observed object: <UIImageView: 0xf277b30; frame = (0 0; 540 576); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0xf277b70>>
    Change: {
        kind = 1;
        new = "NSRect: {{0, 0}, {540, 576}}";
    }
    Context: 0x0'
    *** First throw call stack:
    (0x33a4f88f 0x32541259 0x33a4f789 0x33a4f7ab 0x329b0d63 0x79e33 0x3295813f 0x32957da5 0x3292e997 0x3573ddd3 0x35695b69 0x35695609 0x35695409 0x35694c57 0x356948ff 0x3566f109 0x3566f109 0x3566f109 0x3566f109 0x3566eeed 0x3582d1f7 0x3566ded1 0x7c09f 0x35706a1b 0x35681c53 0x3568757d 0x3236ec2f 0x3209eee7 0x33a222ad 0x339a54a5 0x339a536d 0x32f23439 0x3569ae7d 0x3d7bb 0x3d778)

And the stack trace:

Last Exception Backtrace:
0   CoreFoundation                  0x33a4f88f __exceptionPreprocess + 163
1   libobjc.A.dylib                 0x32541259 objc_exception_throw + 33
2   CoreFoundation                  0x33a4f789 +[NSException raise:format:] + 1
3   CoreFoundation                  0x33a4f7ab +[NSException raise:format:] + 35
4   Foundation                      0x329b0d63 -[NSObject(NSKeyValueObserving) observeValueForKeyPath:ofObject:change:context:] + 83
5   Square                          0x00079e33 -[PDDOMDomainController observeValueForKeyPath:ofObject:change:context:] (PDDOMDomainController.m:453)
6   Foundation                      0x3295813f NSKeyValueNotifyObserver + 259
7   Foundation                      0x32957da5 NSKeyValueDidChange + 325
8   Foundation                      0x3292e997 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 95
9   UIKit                           0x3573ddd3 -[UITableView(_UITableViewPrivate) _updateBackgroundViewFrame] + 87
10  UIKit                           0x35695b69 -[UITableView(_UITableViewPrivate) _updateBackgroundView] + 45
11  UIKit                           0x35695609 -[UITableView setContentOffset:] + 365
12  UIKit                           0x35695409 -[UIScrollView(Static) _adjustContentOffsetIfNecessary] + 1897
13  UIKit                           0x35694c57 -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:dealloc:pin:] + 191
14  UIKit                           0x356948ff -[UIScrollView _didMoveFromWindow:toWindow:] + 83
15  UIKit                           0x3566f109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 425
16  UIKit                           0x3566f109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 425
17  UIKit                           0x3566f109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 425
18  UIKit                           0x3566f109 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 425
19  UIKit                           0x3566eeed -[UIView(Hierarchy) _postMovedFromSuperview:] + 141
20  UIKit                           0x3582d1f7 __UIViewWasRemovedFromSuperview + 107
21  UIKit                           0x3566ded1 -[UIView(Hierarchy) removeFromSuperview] + 165
22  Square                          0x0007c09f -[UIView(Hackery) pd_swizzled_removeFromSuperview] (PDDOMDomainController.m:693)
23  UIKit                           0x35706a1b -[UITransitionView _didCompleteTransition:] + 423
24  UIKit                           0x35681c53 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 471
25  UIKit                           0x3568757d -[UIViewAnimationState animationDidStop:finished:] + 53
26  QuartzCore                      0x3236ec2f CA::Layer::run_animation_callbacks(void*) + 203
27  libdispatch.dylib               0x3209eee7 _dispatch_main_queue_callback_4CF$VARIANT$mp + 195
28  CoreFoundation                  0x33a222ad __CFRunLoopRun + 1269
29  CoreFoundation                  0x339a54a5 CFRunLoopRunSpecific + 301
30  CoreFoundation                  0x339a536d CFRunLoopRunInMode + 105
31  GraphicsServices                0x32f23439 GSEventRunModal + 137
32  UIKit                           0x3569ae7d UIApplicationMain + 1081
33  Square                          0x0003d7bb main (main.m:28)
34  Square                          0x0003d778 start + 40

How to make it work with NSURLConnection

So I've been trying to make it work with my app that uses NSURLConnection to call my APIs, and it's just now (after 3 days and comparing the PDTwitter example) that I realized the example project uses AFnetworking and that kinda affects if the requests get detected.

I basically tried changing (as a test) the one I used from NSURLconnection to ASJSonRequestOperation. Before it would see my app on the listener but will not list anything on the Network tab, now it would show details regarding the request.

Basically my question is, I'm not sure if the NSURLConnection that I used was wrong that's why it wasn't detected or if PonyDebugger just chooses to detect AFNetworking methods only?

I hope my question makes sense.

Thanks!

use PonyDebugger on iPhone

I'm trying to debug an app with my iPhone but I've 2 errors on my code (when I Build&Run the app on the simulator, the app goes DONE!), the errors are:

captura de pantalla 2013-08-06 a la s 11 50 08 am

iOS 7 keyboard

We are using PonyDebugger in a project which is going over to iOS 7 soon and we are finding if we call up the keyboard that we get a crash.

The crash happens on both the simulator and the ipad.

Our setup looks like this:

    PDDebugger *debugger = [PDDebugger defaultInstance];
    NSString *debuggerListenerIp = @"127.0.0.1"; // [standardDefaults stringForKey:@"debuggerListenerIp"];
    if(debuggerListenerIp) {
        NSString *ip = [NSString stringWithFormat:@"ws://%@:9000/device", debuggerListenerIp];
        [debugger connectToURL:[NSURL URLWithString:ip]];
    } else {
            [debugger autoConnect];
    }
    
    [debugger enableNetworkTrafficDebugging];
    [debugger forwardAllNetworkTraffic];
    [debugger enableViewHierarchyDebugging];
    [debugger setDisplayedViewAttributeKeyPaths:@[@"viewControllerName", @"memAddress", @"bounds", @"frame", @"hidden", @"alpha", @"opaque"]];

The backtrace looks like this:

(lldb) bt
* thread #1: tid = 0xe58d0f, 0x0457f88a libobjc.A.dylib`objc_exception_throw, queue = 'com.apple.main-thread, stop reason = breakpoint 2.1
    frame #0: 0x0457f88a libobjc.A.dylib`objc_exception_throw
    frame #1: 0x0479d556 CoreFoundation`-[__NSArrayM objectAtIndex:] + 246
    frame #2: 0x003c98fd p2tf`-[UIView(self=0x0d1bac10, _cmd=0x0216b764, index1=1, index2=219279744) pd_swizzled_exchangeSubviewAtIndex:withSubviewAtIndex:] + 141 at PDDOMDomainController.m:824
    frame #3: 0x0210a79f UIKit`-[_UIBackdropView ensureProperSubviewOrdering] + 666
    frame #4: 0x02109ebe UIKit`-[_UIBackdropView updateSubviewHierarchyIfNeededForSettings:] + 127
    frame #5: 0x0210658d UIKit`-[_UIBackdropView setComputesColorSettings:] + 235
    frame #6: 0x01b7fd6a UIKit`-[UIKBBackdropView triggerUpdate:] + 400
    frame #7: 0x016b2e39 Foundation`__57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke + 40
    frame #8: 0x04858524 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
    frame #9: 0x047b007b CoreFoundation`_CFXNotificationPost + 2859
    frame #10: 0x015ecb91 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 98
    frame #11: 0x01e7f9c7 UIKit`-[UIInputViewTransition postNotificationsForTransitionEnd] + 1054
    frame #12: 0x01e75fe8 UIKit`__53-[UIPeripheralHost(UIKitInternal) executeTransition:]_block_invoke1332 + 455
    frame #13: 0x01a52b75 UIKit`-[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 306
    frame #14: 0x01a3c81c UIKit`-[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267
    frame #15: 0x01a3cb04 UIKit`-[UIViewAnimationState animationDidStop:finished:] + 80
    frame #16: 0x014a0e84 QuartzCore`CA::Layer::run_animation_callbacks(void*) + 304
    frame #17: 0x04b944b0 libdispatch.dylib`_dispatch_client_callout + 14
    frame #18: 0x04b82766 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 340
    frame #19: 0x04861a5e CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
    frame #20: 0x047a272b CoreFoundation`__CFRunLoopRun + 1963
    frame #21: 0x047a1b33 CoreFoundation`CFRunLoopRunSpecific + 467
    frame #22: 0x047a194b CoreFoundation`CFRunLoopRunInMode + 123
    frame #23: 0x05c2d9d7 GraphicsServices`GSEventRunModal + 192
    frame #24: 0x05c2d7fe GraphicsServices`GSEventRun + 104
    frame #25: 0x019f094b UIKit`UIApplicationMain + 1225
    frame #26: 0x00002d32 p2tf`main(argc=5, argv=0xbfffee10) + 178 at main.m:46
    frame #27: 0x04e24725 libdyld.dylib`start + 1

The error message is "* Terminating app due to uncaught exception 'NSRangeException', reason: '* -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'".

screen shot 2013-10-04 at 09 14 56

Request http body is required in PDNetworkDomainController

Hi guys, when trying to make a request that has no HTTP body, we get a crash in PDNetworkDomainController.

The fix was simply a matter of changing this line:

if (contentType && [contentType rangeOfString:@"json"].location != NSNotFound) {

to this:

if (body && contentType && [contentType rangeOfString:@"json"].location != NSNotFound) {

I was going to submit a pull request, but didn't see the option so I guess you guys aren't taking pull requests at this time. Just wanted to let you guys know.

INCREDIBLE work, by the way. I'm a big fan of square and everything they're doing.

NSRangeException in PDDOMDomainController when UIAlertView shown

Running on IPad simulator with the Elements tab of the Chrome Developer opened.

Showing a UIAlertView, I get an NSRangeException.

0  CoreFoundation                      0x0279e5e4 __exceptionPreprocess + 180
1  libobjc.A.dylib                    0x025218b6 objc_exception_throw + 44
2  CoreFoundation                      0x0273f4e6 -[__NSArrayM objectAtIndex:] + 246
3  .........                          0x000a43fe -[PDDOMDomainController addView:] + 1758
4  .........                          0x000a388d -[PDDOMDomainController windowShown:] + 125
5  Foundation                          0x021f4bf9 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke + 40
6  CoreFoundation                      0x027fa524 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
7  CoreFoundation                      0x0275200b _CFXNotificationPost + 2859
8  Foundation                          0x0212e951 -[NSNotificationCenter postNotificationName:object:userInfo:] + 98
9  Foundation                          0x0213de2a -[NSNotificationCenter postNotificationName:object:] + 55
10  UIKit                              0x012cbeb3 -[UIWindow _setHidden:forced:] + 596
11  UIKit                              0x012cc02d -[UIWindow _orderFrontWithoutMakingKey] + 49
12  UIKit                              0x012d689a -[UIWindow makeKeyAndVisible] + 65
13  UIKit                              0x0183c9c7 -[_UIModalItemsCoordinator _presentingViewControllerForAlertCompatibilityCreateIfNeeded:] + 798
14  UIKit                              0x0183c6a4 -[_UIModalItemsCoordinator _presentingViewControllerForAlertCompatibility] + 41
15  UIKit                              0x0177153c -[UIAlertView(Private) popupAlertAnimated:animationType:atOffset:] + 382
16  UIKit                              0x01771963 -[UIAlertView(Private) popupAlertAnimated:animationType:] + 56
17  UIKit                              0x01776948 -[UIAlertView showWithAnimationType:] + 48
18  UIKit                              0x01776976 -[UIAlertView show] + 41

The exception occurs at line 531 in PPDOMDomainController.m
UIWindow *previousWindow = [windows objectAtIndex:indexOfWindow - 1];

As a quick fix, I have replaced

 if (indexOfWindow > 0) { 

by

 if (indexOfWindow > 0 && indexOfWindow != NSNotFound) {

but I think there must be some more complex work to do as it possibly affects a feature.

Missing headers

I have seen that you recently merged some changes into master for a missing headers issue but it's made things worse.
Could you guys follow the setup instructions from the readme and try to see if the test project compiles ?

Projects that already use SocketRocket create duplicate symbols

We have a project that already uses SocketRocket for socket io. When I add PonyDebugger to the project and then build I get duplicate symbols errors for the SocketRocket headers since they are already added to our project. Is there a best practice for either 1) isolating the SocketRocket code so that PonyDebugger and our project each maintain their own versions of SocketRocket , or 2) move to one version of SocketRocket and have PonyDebugger and our project both reference the same code? I'd prefer to have one shared version of SocketRocket but I wanted to see if brighter minds than my own have already dealt with this or have any input.

PonyDebugger causing modals to dismiss without animation

I've found an issue with all modals in my app that are being dismissed with [self dismissModalViewControllerAnimated:YES completion:nil];

When I have PonyDebugger enabled, every modal dismisses without animation. When I turn it off, the modals dismiss with animation like normal.

Getting "ERROR:root:Uncaught exception, closing connection" when browser loads gateway page

I'm on OS X 10.9 (Mavericks), using Python 2.7. I did ponyd update-devtools.

The ponyd server starts just fine:

$ ponyd serve
PonyGateway starting. Listening on 127.0.0.1:9000

I point my Chrome 31.0.1650.34 beta at 127.0.0.1:9000, and get this page:

PonyGateway
Connect a PonyDebugger client to ws://localhost:9000/device.

No Clients Connected
Status: Connecting to gateway...

The terminal shows this trace:

ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 230, in _run_callback
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 204, in on_connection_close
    self.on_close()
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 177, in on_close
    self.app_state.removeLobby(self)
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 59, in removeLobby
    self.lobbies.remove(lobby)
KeyError: <ponyd.gateway.LobbyHandler object at 0x101fdb910>
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 230, in _run_callback
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/httpserver.py", line 353, in _on_headers
    self.request_callback(self._request)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/web.py", line 1204, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 82, in _execute
    self._abort()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 175, in _abort
    self.stream.close()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 180, in close
    self._run_callback(self._close_callback)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 230, in _run_callback
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 204, in on_connection_close
    self.on_close()
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 177, in on_close
    self.app_state.removeLobby(self)
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 59, in removeLobby
    self.lobbies.remove(lobby)
KeyError: <ponyd.gateway.LobbyHandler object at 0x101fdb910>
ERROR:root:Uncaught exception, closing connection.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 199, in _handle_events
    self._handle_read()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 258, in _handle_read
    if self._read_from_buffer():
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 325, in _read_from_buffer
    self._consume(loc + delimiter_len))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 230, in _run_callback
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/httpserver.py", line 353, in _on_headers
    self.request_callback(self._request)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/web.py", line 1204, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 82, in _execute
    self._abort()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 175, in _abort
    self.stream.close()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 180, in close
    self._run_callback(self._close_callback)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 230, in _run_callback
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 204, in on_connection_close
    self.on_close()
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 177, in on_close
    self.app_state.removeLobby(self)
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 59, in removeLobby
    self.lobbies.remove(lobby)
KeyError: <ponyd.gateway.LobbyHandler object at 0x101fdb910>
ERROR:root:Exception in I/O handler for fd 20
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/ioloop.py", line 269, in start
    self._handlers[fd](fd, events)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 199, in _handle_events
    self._handle_read()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 258, in _handle_read
    if self._read_from_buffer():
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 325, in _read_from_buffer
    self._consume(loc + delimiter_len))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 230, in _run_callback
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/httpserver.py", line 353, in _on_headers
    self.request_callback(self._request)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/web.py", line 1204, in __call__
    handler._execute(transforms, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 82, in _execute
    self._abort()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 175, in _abort
    self.stream.close()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 180, in close
    self._run_callback(self._close_callback)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/iostream.py", line 230, in _run_callback
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/stack_context.py", line 173, in wrapped
    callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tornado/websocket.py", line 204, in on_connection_close
    self.on_close()
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 177, in on_close
    self.app_state.removeLobby(self)
  File "/Users/aneil/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 59, in removeLobby
    self.lobbies.remove(lobby)
KeyError: <ponyd.gateway.LobbyHandler object at 0x101fdb910>

Adding Fields to DevTools

Hi,

I'm thinking about adding a Predicate-Filter for the CoreData-Inspector. I've made my way through the sources to place where I would need to extend the DomainController. Where would I add a different field (maybe next to the key range (which isn't used so far)) to DevTools? Is that even possible without including the sources?

Hope you can give me some hints.

Best,

Karl

Any plans to update to make it work with NSURLSession?

I have moved over to use AFNetworking 2.0 which is built on NSURLSession.

However, PonyDebugger only inspects the NSURLConnection requests so inspecting network traffic by AFNetworking when using NSURLSession isn't possible.

Any plans to update to be compatible with NSURLSession?

Add timeout to ponyd

I currently have ponyd setup to run at all times on my computer, however ponyd doesn't seem to clean up apps/devices, which are no longer runnning.

I currently have 235 apps in ponyd, where none of these are running anymore.

Could you add some sort of timeout option to ponyd, so apps not updated after 1 hour or 24 hours, are removed from the list?

Mention CocoaPod based installation in the readme

Having a pod based installation available makes me much more likely to try a tool like PonyDebugger. It would be nice to see a CocoaPods based installation mentioned in the readme as a suggested install process. I think you'll find that this leads to more use of the tool and fewer frustrated users becoming confused while trying to install manually. It also makes staying up to date with new PonyDebugger releases easier.

Managed Object subclasses mixed with parent classes

I have an entity called Item, and some subclasses of it like RecommendationItem.

In pony debugger when I go to my store and select Item entity I see some Items mixed with RecommendationItem in the list of objects. I was expecting to see only Item objects.

Is that normal?

PonyDebugger from real device

More of a question than an issue.

No hitch using PonyDebugger from the iOS Simulator. But I haven't been able to connect to ponyd from a real device, despite trying a few options:

  1. leaving everything as-is
  2. launching ponyd serve --listen-interface=[iphone IP address]
  3. running on a real device changing the connectToURL to [debugger connectToURL:[NSURL URLWithString:@"ws://[mac IP address]:9000/device"]];
  4. 2 & 3 combined

I've seen a few references to ponyd working for both simulator and real devices, but haven't seen any documentation to support it.

Thoughts?

Thanks

can't excute the command

zhangmatoMacBook-Pro:Desktop zn88358800$ curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
New python executable in /Users/zn88358800/Library/PonyDebugger/bin/python
Installing setuptools.....................
Complete output from command /Users/zn88358800/Li...yDebugger/bin/python -c "#!python
"""Bootstra...sys.argv[1:])

" --always-copy -U setuptools:
Traceback (most recent call last):
File "", line 279, in
File "", line 240, in main
File "/Users/zn88358800/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c12dev_r88997-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
File "/Users/zn88358800/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c12dev_r88997-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "/Users/zn88358800/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c12dev_r88997-py2.7.egg/setuptools/command/easy_install.py", line 1716, in
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/Users/zn88358800/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c12dev_r88997-py2.7.egg/setuptools/command/easy_install.py", line 171, in finalize_options
File "/Users/zn88358800/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c12dev_r88997-py2.7.egg/setuptools/package_index.py", line 161, in init
File "/Users/zn88358800/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c12dev_r88997-py2.7.egg/setuptools/ssl_support.py", line 239, in find_ca_bundle

NameError: global name 'pkg_resources' is not defined

...Installing setuptools...done.
Traceback (most recent call last):
File "", line 2462, in
File "", line 944, in main
File "", line 1054, in create_environment
File "", line 600, in install_setuptools
File "", line 572, in _install_req
File "", line 1022, in call_subprocess
OSError: Command /Users/zn88358800/Li...yDebugger/bin/python -c "#!python
"""Bootstra...sys.argv[1:])

" --always-copy -U setuptools failed with error code 1

how can i install it in a right way??

Removing PonyDebugger from Release builds

This isn't really a issue, but more of a question.

I am wondering what the best practice is for getting a release build that isn't linked with PonyDebugger. Ideally, I would like to keep the release build the same as before integrating with PonyDebugger. Is there a good way to do this?

iOS application connects, but no HTTP traffic is shown in the dev

Hi!

I have a simple iOS project (CocoaPods based), where I wanted to try the PonyDebugger.
Following the instructions, I do see the debugger/app is connected.

I have created a screenshot for this:
http://people.apache.org/~matzew/ConnecetedButNoTrafficVisible.png

But on every request I make (via the only button on the 'view') I do never see any traffic in the console...
(see above screenshot)

Note: the underlying HTTP client is AFNetworking (behind a tiny wrapper API), Version 1.0RC1)

BTW... in the IDE console you see a bit of JSON response, that I am getting from the HTTP GET request.

In case you want to open the workspace, I did an upload of the project to github:
(the ponydebugger branch):
https://github.com/aerogear/aerogear-todo-ios/tree/ponydebugger

Connect to Pony Gateway failing with "Debugger Closed" message

Ran through the install instructions. Everything is working fine. But when I visit the gateway in the web browser it shows that my device is not connected. I used the example code in app delegate :

PDDebugger *debugger = [PDDebugger defaultInstance];

[debugger enableNetworkTrafficDebugging];
[debugger forwardAllNetworkTraffic];
[debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9000/device"]];

In the console log in xcode shortly after start the only message I see from the debugger is:

Debugger closed

Any ideas what's going on here?

Setup for the ponyd devtools initially goes into a different folder than expected

The initial download puts the dev tools in ~/Library/PonyDebugger/src/devtools

    Downloading http://storage.googleapis.com/chromium-browser-continuous/Mac/152100/devtools_frontend.zip
    Extracting to /Users/orta/Library/PonyDebugger/src/devtools

But the ponyd command expects to find it, to fix it it's possible to just run ponyd update-devtools but this isn't obvious based on the output:

   [energy] ponyd serve --listen-interface=127.0.0.1                                                                                                                                                                                                                                                                                           
   Error: devtools directory /usr/local/src/devtools does not exist. Use ponydownloader to download a compatible version of Chrome Developer Tools.
[energy] ponyd update-devtools                                                                                                                      
Downloading http://storage.googleapis.com/chromium-browser-continuous/Mac/152100/devtools_frontend.zip
Extracting to /usr/local/src/devtools

[energy] ponyd serve --listen-interface=127.0.0.1                                                                                                   
PonyGateway starting. Listening on 127.0.0.1:9000

Autorefresh for each build

A great UI improvement would be to make the debugger refresh to the latest version when you create a new build. It feels pretty cumbersome to have to go back to the home page to find what page you are supposed to be on whenever you want to debug something.

I could work on this if people think it's worthwhile.

Connection w/ remote server lost when iphone screen off.

The connection is lost to the remote server when you turn the screen off on the iphone. Xcode debugger prints this message:

Debugger failed with web socket error: The operation couldn’t be completed. Socket is not connected

And the device doesn't show up the PonyGateway webpage anymore.

It happens almost instantly after the screen times out.

My app has settings to run the background: Bluetooth Central

Inspect mode magnifying glass inaccessible in latest Chrome and Chrome Canary builds.

I've been running PonyDebugger 0.3.0 with no problems for weeks.

As of a few days ago I've been unable to access inspect mode as the magnifying glass has completely disappeared from the bottom left of Chrome Developer Tools when browsing iosml nodes in the Elements tab.

Not sure if this is a simple configuration problem on my end or if it's a problem in general, but I don't seem to have changed anything. Anyone in a similar position?

pony-chrome

Integration with Cycript / runtime manipulation

I was thinking about integration of Cycript (http://www.cycript.org) into this project which is a bridge between Objective-C and JavaScript and allow one to manipulate Objective-C runtime in running apps. I have already figured out a way to inject PonyDebugger into running 3rd-party apps (on a jailbroken device), which gives a great way to explore how the layout/UI of different apps is built. But it would certainly be nice to also have a way to access the Objective-C runtime and execute Cycript/Objective-C commands in the Chrome Developer Tools.
What do you guys think? Is there any pointers on how to extend the console in Chrome Developer Tools with additional functionality?

trying step #1 of QuickStart fails on a Mountain Lion iMac

steps to reproduce:

  1. open Terminal
  2. copy/paste the "curl … | python …" command

expected result: not failure
actual result: failure with error code 1

Terminal output:


deeje-thirst-iMac:~ deeje$ curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | \
>   python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
New python executable in /Users/deeje/Library/PonyDebugger/bin/python
Installing setuptools..........
  Complete output from command /Users/deeje/Library/PonyDebugger/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])






" --always-copy -U setuptools:
  Traceback (most recent call last):
  File "<string>", line 279, in <module>
  File "<string>", line 211, in main
  File "<string>", line 140, in download_setuptools
  File "/Users/deeje/Library/PonyDebugger/lib/python2.7/distutils/__init__.py", line 16, in <module>
    exec(open(os.path.join(distutils_path, '__init__.py')).read())
IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py'
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
  File "<stdin>", line 2462, in <module>
  File "<stdin>", line 944, in main
  File "<stdin>", line 1054, in create_environment
  File "<stdin>", line 600, in install_setuptools
  File "<stdin>", line 572, in _install_req
  File "<stdin>", line 1022, in call_subprocess
OSError: Command /Users/deeje/Library/PonyDebugger/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])






" --always-copy -U setuptools failed with error code 1

Removed MOCs don't disappear until devtools are reloaded

In an app with multiple child-parent MOCs, the child MOCs that are being registered with the PDDebugger singleton aren't disappearing from the list of MOCs (in devtools) when removeManagedObjectContext: is called. When the _broadcastDatabaseNames method is called (in PDIndexedDBDomainController), the change is seems to be reflected in the broadcasted dbNames array, but it doesn't seem to update in the devtools page until its been reloaded entirely. The removed MOCs show up in the list under "IndexedDB", but don't have anything in any of their tables, so they're obviously disconnected—it's just not updated in the list. Any ideas?

Add additional tabs to devtools to support further communication channels

This is rather a question than an issue. I am considering adding support for debugging Bluetooth LE connections using Pony Debugger. In order to not clutter the network tab, I'd like to add another tab to the DevTools. Adding tabs doesn't seem to be a hard thing to do (see http://developer.chrome.com/extensions/devtools.panels.html), however, I fail to see how I could register a Chrome extension with the version of Chrome DevTools that PonyDebugger downloads. Can anyone provide some pointers?

Cannot connect to the debugger when using a device

Hi there,

I've seen two issues related to this in this forum, but both 'resolutions' don't seem to be helping.

I am using PonyDebugger - and it works fantastically in the Simulator. However, when I move to debug on the device, I get a console output of "Debugger Failed". Stepping into this, the exact error is:

Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn’t be completed. Connection refused

I had started ponyd using the command ponyd serve --listen-interface=0.0.0.0, and the accepted all incoming connections after I was prompted.

I've cleaned my project, deleted it from my phone, and every combination I can think of.

Does anyone have any ideas??? I'm at a loss.

Cheers,
Brett

Integration with RuntimeBrowser project

That's a great project, thanks for everyone contributing in it. I have a suggestion - it would be great to extend it with functionality of the RuntimeBrowser https://github.com/nst/RuntimeBrowser project, which give you full access to all classes loaded in the runtime, shows every method implemented on each class and displays information in a header (.h) file format.

What do you guys think? I am ready to contribute to this, but I need some help - which classes do I need to extend, how do I get started?

Is PonyDebugger App Store safe?

Just wondering if PonyDebugger is safe for including in an app store submission?

Debugger would be #define'd out but the code (I build the source within my app) would still be present.

inspecting custom data types

Hello and thank you for sharing this amazing project. Great work.

Im looking for some basic instructions on how to add inspection of custom datatypes similar to how the view inspection works. I have a hierarchy of custom classes that i would like to add remote inspection to.

Thanks.

Can't install. Git timeout

Not sure if this is on my end or what, but I keep getting timeouts when I use the bootstrap script. Here's the output I keep seeing. Any thoughts on this?

Thanks!

Serenity:~ david$ curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
New python executable in /Users/david/Library/PonyDebugger/bin/python
Installing setuptools..................done.
Installing pip.............done.
Obtaining ponydebugger from git+https://github.com/square/PonyDebugger.git#egg=ponydebugger
Cloning https://github.com/square/PonyDebugger.git to ./Library/PonyDebugger/src/ponydebugger
error: Failed connect to github.com:8888; Operation timed out while accessing https://github.com/square/PonyDebugger.git/info/refs
fatal: HTTP request failed
Complete output from command /usr/bin/git clone -q https://github.com/square/PonyDebugger.git /Users/david/Library/PonyDebugger/src/ponydebugger:


Command /usr/bin/git clone -q https://github.com/square/PonyDebugger.git /Users/david/Library/PonyDebugger/src/ponydebugger failed with error code 128 in None
Storing complete log in /Users/david/.pip/pip.log
Traceback (most recent call last):
File "", line 2462, in
File "", line 946, in main
File "", line 1794, in after_install
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 511, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/david/Library/PonyDebugger/bin/pip', 'install', '-U', '-e', 'git+https://github.com/square/PonyDebugger.git#egg=ponydebugger']' returned non-zero exit status 1

Remote inspect of NSUserDefault

Hi,

greetings from Italy and thanks for this wonderful project!!

Do you think a remote NSUserDefault browser would be do-able? (like the CoreData one, but for NSUserDefault settings)..

I think this would be veeeery useful for remote debugging/inspecting data.

For example, something like this:

PDDebugger *debugger = [PDDebugger defaultInstance];

[debugger enableNSUserDataDebugging];

// for '[NSUserDefaults standardUserDefaults]' browsing
[debugger addNSUserData:nil withName:@"Default User"];

// for '[[NSUserDefaults alloc] initWithUser:@"myuser"]' browsing
[debugger addNSUserData:@"myuser" withName:@"My User"];

Thanks in advance for your time!

How to get network data from Chrome Dev Tools after PonyDebugger feeds data into the Tools?

I am using PonyDebugger to debug network traffic in iOS app, and I can see nice network data in the network panel of Chrome Dev Tools. However, it seems that I couldn't save HARs (I tried both launching Dev Tools instances in Chrome and Safari, it seems neither supports saving Entry as HARs). My question is how to extract the network data that is fed by PonyDebugger? And is there any programmatic way to get it instead of inspecting network panel manually?

Any pointers on this will be helpful.

PonyDebugger is failing for me with status in console "Debugger Failed"

It worked for me once but then after I keep getting,

PonyDebugger Warning: -[PDNetworkDomainController connection:willSendRequest:redirectResponse:] not called, request timestamp may be inaccurate. See Known Issues in the README for more information.

Debugger failed

I've updated my ~/Library/PonyDebugger/src/ponydebugger to latest branch and restarted ponyd but I am still getting those two messages in my console.

Thanks.

Sample PDTwitterTest less useful due to Twitter API v1.0 retirement

Posting a GET request to https://search.twitter.com/search.json?q=@square results in 410 GONE code due to retirement of Twitter's v1.0 API: https://dev.twitter.com/blog/api-v1-retirement-final-dates

While this is indeed a sample network response for us to examine via PonyDebugger, its not as helpful an example as it would be with some twitter data responses + data loaded into the tableview.

As well, it's a bit misleading -- I was expecting some twitter search results, and the error initially lead me to think I wasn't running the sample correctly, or had mysterious ponyd configuration problems.

Failure trying to update to latest devtools version

Hi,

I noticed the Chrome Dev Tools project stopped updating devtools_frontend.zip on their continuous build server.
See https://code.google.com/p/chromium/issues/detail?id=160561

They now advise people to use the blink repository directly and play with the Dev Tools files in WebKit/Source/WebCore/inspector.

PonyDebugger could clone the repository instead of downloading the zip, but I'm afraid it's way too big (over 4 Gigs!).
Another way would be to package and host a zip of WebKit/Source/WebCore/inspector regularly ourself.

So I wonder what would be best for the PonyDebugger project.
What's your take on this @ryanolsonk @mikelikespie @wlue?

As a reference, here's the current output if you try to get the latest devtools with ponyd:

 $ ponyd update-devtools --latest
Downloading http://storage.googleapis.com/chromium-browser-continuous/Mac/192797/devtools_frontend.zip
Traceback (most recent call last):
  File "/Users/jean/.virtualenvs/ponydenv/bin/ponyd", line 8, in <module>
    load_entry_point('ponyd==1.0', 'console_scripts', 'ponyd')()
  File "/Users/jean/Developments/my-PonyDebugger/ponyd/argbase.py", line 149, in main
    args.command(args)
  File "/Users/jean/Developments/my-PonyDebugger/ponyd/argbase.py", line 128, in run_command
    return instance()
  File "/Users/jean/Developments/my-PonyDebugger/ponyd/downloader.py", line 36, in __call__
    tools_stream = StringIO(urllib2.urlopen(tools_url).read())
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.