

PonyDebugger: Chrome Developer Tools for Native iOS Apps - wlue
http://corner.squareup.com/2012/08/ponydebugger-remote-debugging.html

======
jazzychad
I saw a demo of this a couple months ago at a small gathering. I was blown
away. Another feature demo'd at the time was the ability to make obj-c calls
in the chrome javascript console and have it be interpreted in the app
runtime. e.g.

UIApplication.sharedApplication.delegate.navigationController.navigationBar.tintColor
= UIColor.redColor;

and the app's navbar changed color. Is this still possible with this release?
I haven't been able to try it out at work yet. Thanks for this awesome tool.

~~~
mikelikespie
Interactive console support is coming. We need to work out a few kinks before
it is ready to go

~~~
conradev
Have you heard of Cycript? It's an open source JavaScript-ObjC bridge,
maintained by Jay Freeman, the creator of Cydia. It currently supports this
interactive console functionality (with tabbed autocomplete!), by injecting
into a specified process.

It would be awesome if you integrated Cycript into this.

<http://cycript.org>

~~~
saurik
They apparently seem to be using JSCocoa (which I find kind of a surprising
choice in comparison to Cycript, but hey: I'm biased ;P).

(edit:)

Looking into the debugger protocol some, it seems like it might be irritating
to integrate Cycript and have it work with Chrome. (The problem being that it
parses the JavaScript on the client and sends over an RPC, do you'd have to
drop down to objc_msgSend semantics; one of the things I had disliked about
JSCocoa then actually makes it easier to use in this environment: how it kind
of munges all of the namespaces together into object properties.)

The entire idea of mapping the semantics of a native app into the HTML reality
of that debugger, however, is somewhat awkward if you want to attack the parts
that aren't networking and database (which is what PonyDebugger is currently
nailing really well). I was working on something a little more general a while
back as part of Cynoptica (mapping all processes to an HTML debugger
interface); when I have something I'll hit you up on IRC.

------
rsbrown
This looks like a really valuable tool to have in the iOS development arsenal.

It also underscores my loathing for cutesy, irreverent naming conventions.

~~~
mikelikespie
The name came about because our internal HTTP library is named PonyExpress,
and this tool was originally part of it. At least it is google-able, right?

~~~
Wohlf
Honestly it's better than another acronym. It's more identifiable and doesn't
have other possible meanings.

------
scottostler
Awesome, will definitely give this a shot. It's great to see iOS development
tools pick up tricks from the web world.

Personally, I can't wait for a Firebug-like tool for live debugging and
tweaking of UIView hierarchies.

~~~
irrationalfab
Have you seen <https://github.com/glock45/iOS-Hierarchy-Viewer>?

~~~
scottostler
Yes, and also DCIntrospect. They're encouraging, but don't currently compare
to what you can do with, say, live-editing css or with a Javascript console.

Not that I've used it, but RubyMotion is making progress on a related front. A
live REPL, styling apps with CSS, etc. Maybe we're not far off.

~~~
saurik
The live REPL is provided by Cycript (a program I wrote that lets you inject
into running iOS/Mac applications: it has a blend of Objective-C and
JavaScript syntax with runtime tab-completion; it is used by most of the
people doing extension development for jailbroken devices as it lets you dig
deeply into any running program quite quickly).

------
devinfoley
It seems that the state iOS development is improving at a very rapid pace. I
can't wait to try this out.

------
mikemurray
Thanks for this! The Core-Data Browser will be especially useful for me.
Verifying data was correctly stored had been somewhat of a pain before.

------
Nemisis7654
This looks fantastic. Does anyone know if there is a similar tool for Android?

~~~
ale55andro
Remote debugging ( Chrome for Android ) has been around for a while :
<https://developers.google.com/chrome/mobile/docs/debugging>

~~~
king_jester
Also, ADB runs over network easily as of ICS using the option in 'Developer
options' in the system setting.

~~~
Nemisis7654
Hmmm..For some reason, I cannot seem to find any setting in "Developer
Options" on my Jelly Bean based device. Can you tell me what it is called?

------
alexbell
This will improve my life I think, installing now and thank you!

~~~
mikelikespie
Glad to hear. If you run into any issues, please file it on the github page.
We tried to simplify it a lot, but there are a lot of moving parts and we can
improve even more.

------
se85
Wow, I never thought it would be possible to use the webkit developer tools
for a completely different technology stack to such an extent.

Impressive to say the least.

------
est
This is really cool for my projects, however, are there any other tools that
can be used ananlyze other binaries without compiling?

------
Codhisattva
Impressive looking tool. I hope the intern is getting paid because he's adding
a lot of value to Square and the dev community too. (Seems like a chance to
plug <http://gittip.com/> now!)

~~~
BHSPitMonkey
I believe it wouldn't even be legal for an unpaid intern to be used for
"actual work", as they're supposed to strictly be involved in
mentoring/training activities. Hopefully Square knows that, and wouldn't try
to treat its employees unfairly in the first place. They seem like a great
company.

~~~
eridius
Programming internships are typically paid positions. I can't speak for
Square, but every other programming internship I'm aware of (even at other
startups like Path) were paid.

~~~
xuancongwen
Yes, we _do_ pay our interns.

------
boerni1234
It's also possible to inspect HTML/JS on WebView based apps (phonegap)?

~~~
masklinn
That's been possible since the release of iOS5 through a private API (which is
sufficient for debugging): [http://atnan.com/blog/2011/11/17/enabling-remote-
debugging-v...](http://atnan.com/blog/2011/11/17/enabling-remote-debugging-
via-private-apis-in-mobile-safari/)

iOS6 makes the feature officially supported (though the API for webview-based
apps is probably different, I haven't checked):
[http://taitems.tumblr.com/post/24936855546/what-
ios-6-mobile...](http://taitems.tumblr.com/post/24936855546/what-ios-6-mobile-
safari-offers-front-end-devs)

------
devonbleak
Interesting tool.

I've done something like this in the past using Charles or Fiddler and the
proxy settings on my iOS device.

------
tylerc230
What is the advantage of this tool over Charles?

~~~
eridius
Charles requires you to proxy your device's networking through your computer,
which is annoying to set up, and doubly-so if you need to sniff https.
PonyDebugger looks great because it doesn't interfere with the normal
networking behavior.

~~~
e28eta
Except requiring you to compile it into your app. Presumably you're not
including it in every build configuration, but that means you can't run it
against just any build.

I think it only does outgoing requests, but rvictl can also be handy for
inspecting iOS network traffic. With a single command on your Mac, it directs
device traffic through a network interface on the Mac. Wireshark works great
on it.

------
goggles99
Very cool - but seems like more of a monitor than a debugger (titles are
always over-sensationalized I suppose).

