OCDebugger 0.0.1

OCDebugger 0.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jun 2015

Maintained by PonyCui.



 
Depends on:
Aspects>= 0
SocketRocket>= 0
 

  • By
  • PonyCui

Chinese README

OCDebugger is an easy to use debugging toolset. You use OCDebugger debug your application on Web or iPhone. It's a client library and we provide an web application (OCDServer) holding all connection from iOS. Also, we provide a public web application here Open link, please feel free to use it, it's really stable.

Unlike PonyDebugger, OCDebugger don't requires open Chrome Developer Tools, you may debug your application using Safari, Chrome, Firefox, or even IE10+ .

OCDebugger is licensed under MIT.

Features

Remote and Local Dashboard

To read debug data, you can shake your mobile phone any time, or use PC/Mac open web application Open link

HTTP Watcher (Network Traffic Debugging)

OCDebugger use NSURLProtocol sniff all network connections. All you need to do is, open web application, wait for the connection information comes.

OCDebugger use Foundation Framework sniff network traffic. This means that all http/https is debuggable. And, all trading network library can be sniffer by OCDebugger including AFNetworking/SDWebImage etc. But, if network library use CFNetwork C++ function, OCDebugger HTTP Watcher will have no effects.

OCDebugger will handle less 32K response data, and send to server, web application will try to convert JSON into pretty style. The request header and response header are also handled.

You can change the Request Header or Request Body, click Resend button, make a different request again.

Host binding

You use following code binding a host to specific IP, it's really useful.

[OCDebugger setHost:@"www.github.com" IPAddress:@"127.0.0.1"];

HTTP Request Mapping

Mapping modifier is now available. You use Mapping modify specific Request URL, the specific scheme/host/port/path/query all support pattern search.

For example, if I wonder a request https://www.google.com/ modify to https://www.github.com/, what I need to do is add a Mapping rule as below.

All fix is realtime effects.

HTTP Response Rewrite

Rewrite modifier is also available. You use Rewrite modify response text for specific ResponseURL. The specific scheme/host/port/path/query all support pattern search.

If I wonder the response of host www.github.com "GitHub" word replace as "Hacked", what I need to do is add a Rewrite rule as below.

All fix is realtime effects.

Remote and Local Logging

OCDebugger makes logging much easier than you thing. You #import "OCDebugger.h" into prefix header file. That's enough. All NSLog() message will send to server and save in local. And we eager to do more, we want to debug like lldb, and we will finish it next version.

All logging is realtime transferring.

Debug Point

OCDebugger invent a way to debug faster, the Debug Point! We call it Point. If you want to replace a variable while running an app, how can you do with that? Maybe you will setup an remote server, set a JSON mapping file? Maybe you will use local code to perform it? Here is an example.

- (BOOL)testPoint {
    OCDValuePoint(@"test", YES);
    return NO;
}

- (NSString *)testText {
    OCDObjectPoint(@"How", @"How?");
    return @"What?";
}

We add point into testPoint and testText method, and then, if we make Point valid, it will return the assigning value or object. The difference of OCDValuePoint and OCDObjectPoint is, OCDValuePoint returns bool/int value, OCDObjectPoint returns NSObject.

We use local or remote control make Point valid or invalid.

Finder

OCDebugger can operate file using shell like interface. The following cmd is supported.

cd..    cd directory     cd /

ls      ls directory

rm file     rm directory     rm *

vi file     use :w save changes     use :q quit vi mode

clear

More

We eager to develop more function to every developer. Please star OCDebugger, keep eyes with me. Thanks.

Installation

Technical

  • Requeires iOS 6.0 or above (but I didn't test under iOS6)
  • Xcode 6.3

Installing

Manual

No recommend use manual installing.

Usage

Copy OCDPrefixHeader.h to your project manually, it should not depend of Pods directory.

import OCDebugger.h and OCDPrefixHeader.h to your project prefix header file.

Go to web application Open link , request an appid.

Type following code in any where you want.(Recommend applicaton:didFinishLaunchingWithOptions:)

[OCDebugger setAppID:@"yourappid" appToken:@"yourapptoken"];
[OCDebugger setEnabled:YES];

Enjoy now.

Caution

Before you release your application, you must remove OCDebugger, and pod update. OCDebugger is not a production environment library.

TODO

There are still lots of issue we should resolve, here is a listing.

1.WebSocket can't transfer large size content, and SAE limit it's 16K, so I'm trying to solve this problem. Now support 64K and larger.

2.Finder request and response too slow, because PHP limit sleep() 1s per time, so I'm trying to fix it.

3.JSON String value contains \n \r will face transfer issue under SAE.