测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布时间最新发布 | 2014年12月 |
由 Toshihiro Morimoto 维护。
简单的调试截图工具。
它可以发送调试信息到电子邮件、Slack 或输出图像。
如果创建适配器,也可以添加输出目标。
1) 在您的 Podfile 中
pod 'DFTDebugScreenShot'
2) 在您的 .m 文件中
#import <DFTDebugScreenshot/DFTDebugScreenshot.h>
3) 在代码中(- [UIViewController dft_debugObjectForDebugScreenshot]
)写入调试信息。
以这种方式编码,会输出 NSUserDefaults 字典。
@implementation DFTViewController
...
- (id)dft_debugObjectForDebugScreenshot {
return [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
}
...
@end
在截图时,会自动执行捕获。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
...
[DFTDebugScreenshot setTracking:YES];
...
}
$ pod install
$ open DFTDebugScreenshotDemo.xcworkspace
您可以在任何时候执行捕获。
- (IBAction)touchedCaptureButton {
[DFNDebugScreenshot capture];
}
您可以通过使用 NSException 和 NSError 执行捕获。
[DFNDebugScreenshot captureWithError:error];
[DFNDebugScreenshot captureWithException:exception];
您希望始终显示内容。
[DFNDebugScreenshot addUserDefineContentWithTitle:@"title" content:@"content"]
您可以从 'SERIALIZE' 部分的文本进行反序列化。
id debugObject = [DFTDebugScreenshot unarchiveWithObjectHex:@"<62706c69 73743030 d4010203 040506bb bc582476 65727369 6f6e5824 6f626a65 63747359 24617263 68697665 72542474 6f701200 0186a0af 102c0708 19242526 2728292a 313b3c3d 47484953 54555f60 616b6c6d 77787983 84858f90 919b9c9d a7a8a9b3 b4b55524 6e756c6c d2090a0b 185a4e53 2e6f626a 65637473 5624636c 617373ac 0c0d0e0f 10111213 14151617 8002800a 800d8010 80138016 8019801c 801f8022 80258028 802bd31a 090a1b1f 23574e53 2e6b6579 73a31c1d 1e800380 048005a3 20212280 06800780 08800952 6964546e 616d6559 696d706f 7274616e 74100157 6e616d65 3a20315f 10285468 6520696e 666f726d 6174696f 6e206973 20726571 75697265 6420666f 72206465 6275672e 2e2ed22b 2c2d2e5a 24636c61 73736e61 6d655824 636c6173 7365735c 4e534469 6374696f 6e617279 a22f305c 4e534469 6374696f 6e617279 584e534f 626a6563 74d31a09 0a323623 a31c1d1e 80038004 8005a337 3822800b 800c8008 80091002 576e616d 653a2032 d31a090a 3e4223a3 1c1d1e80 03800480 05a34344 22800e80 0f800880 09100357 6e616d65 3a2033d3 1a090a4a 4e23a31c 1d1e8003 80048005 a34f5022 80118012 80088009 1004576e 616d653a 2034d31a 090a565a 23a31c1d 1e800380 048005a3 5b5c2280 14801580 08800910 05576e61 6d653a20 35d31a09 0a626623 a31c1d1e 80038004 8005a367 68228017 80188008 80091006 576e616d 653a2036 d31a090a 6e7223a3 1c1d1e80 03800480 05a37374 22801a80 1b800880 09100757 6e616d65 3a2037d3 1a090a7a 7e23a31c 1d1e8003 80048005 a37f8022 801d801e 80088009 1008576e 616d653a 2038d31a 090a868a 23a31c1d 1e800380 048005a3 8b8c2280 20802180 08800910 09576e61 6d653a20 39d31a09 0a929623 a31c1d1e 80038004 8005a397 98228023 80248008 8009100a 586e616d 653a2031 30d31a09 0a9ea223 a31c1d1e 80038004 8005a3a3 a4228026 80278008 8009100b 586e616d 653a2031 31d31a09 0aaaae23 a31c1d1e 80038004 8005a3af b0228029 802a8008 8009100c 586e616d 653a2031 32d22b2c b6b75e4e 534d7574 61626c65 41727261 79a3b8b9 ba5e4e53 4d757461 626c6541 72726179 574e5341 72726179 584e534f 626a6563 745f100f 4e534b65 79656441 72636869 766572d1 bdbe5472 6f6f7480 01000800 11001a00 23002d00 32003700 66006c00 71007c00 83009000 92009400 96009800 9a009c00 9e00a000 a200a400 a600a800 aa00b100 b900bd00 bf00c100 c300c700 c900cb00 cd00cf00 d200d700 e100e300 eb011601 1b012601 2f013c01 3f014c01 55015c01 60016201 64016601 6a016c01 6e017001 72017401 7c018301 87018901 8b018d01 91019301 95019701 99019b01 a301aa01 ae01b001 b201b401 b801ba01 bc01be01 c001c201 ca01d101 d501d701 d901db01 df01e101 e301e501 e701e901 f101f801 fc01fe02 00020202 06020802 0a020c02 0e021002 18021f02 23022502 27022902 2d022f02 31023302 35023702 3f024602 4a024c02 4e025002 54025602 58025a02 5c025e02 66026d02 71027302 75027702 7b027d02 7f028102 83028502 8d029402 98029a02 9c029e02 a202a402 a602a802 aa02ac02 b502bc02 c002c202 c402c602 ca02cc02 ce02d002 d202d402 dd02e402 e802ea02 ec02ee02 f202f402 f602f802 fa02fc03 05030a03 19031d03 2c033403 3d034f03 52035700 00000000 00020100 00000000 0000bf00 00000000 00000000 00000000 000359>"];
/*
2014-10-05 01:25:30.060 DFTDebugScreenShotDemo[99801:2776797] (
{
id = 1;
important = "The information is required for debug...";
name = "name: 1";
},
...
)
*/
您可以使用 DFTDebugScreenshotMailAdapter 和 DFTDebugScreenshotSlackAdapter。
请添加 Incoming WebHooks 的服务集成。 (URL)
NSURL *url = [NSURL urlWithString:incomming_webhooks_url];
[DFTDebugScreenshot addAdapter:[[DFTDebugScreenshotSlackAdapter alloc] initWithIncomingWebHookURL:incomming_url]];
邮件适配器
[DFTDebugScreenshot addAdapter:[DFTDebugScreenshotMailAdapter new]];
见 发布
版权 (c) 2014 Toshihiro Morimoto
本授权协议授予任何获得本软件及其相关文档文件(统称为“软件”)副本的个人免费使用本软件的权利,不受限制,包括但不限于使用、复制、修改、合并、发布、分发、转授权和/或出售软件副本的权利,并允许提供软件的个人或实体履行上述行为,但须遵守以下条件:
上述版权声明和本许可声明应包含在软件的所有副本或实质性部分中。
软件按“现状”提供,不对任何形式的明示或默示保证,包括但不限于对其适用性、特定用途合适性及不侵犯他人权利的保证。在任何情况下,作者或版权所有者不对任何索赔、损害或其它责任负责,无论是在合同、侵权或其他行为中产生的索赔、损害或其它责任,无论是源于、有关或与本软件或使用本软件相关。