REVEAL:Version 1.5.1(4946)
Xcode 8.3
模拟器模拟:iPhone 6 - iOS 10.3(14E269)
真机测试:iPhone6 plus / iOS 9.3.1
模拟器###
1.创建一个新的OC测试工程
2.打开Reveal,点击工具栏Help->Show Reveal Library in Finder,将Reveal.framework静态库添加到工程中。
![](https://img.haomeiwen.com/i2818652/210f13614dec618b.png)
3.静态库引用设置。
![](https://img.haomeiwen.com/i2818652/7bb6ea1a88d16c86.png)
4.添加系统依赖库。
![](https://img.haomeiwen.com/i2818652/e9e6c2fac02b6e8a.png)
5.打开Reveal并选择设备运行模拟器.
![](https://img.haomeiwen.com/i2818652/fc763486d525e755.png)
真机###
1.获取libReveal.dylib库
![](https://img.haomeiwen.com/i2818652/864568ab7e17603e.png)
2.将库添加到Reveal项目中:注意不要 Add to targets:Reveal
.
![](https://img.haomeiwen.com/i2818652/494a58c571233536.png)
![](https://img.haomeiwen.com/i2818652/ab6ca98e698c9e8e.png)
3.添加系统依赖库:CFNetwork.framework
,QuartzCore.framework
,CoreGraphics.framework
![](https://img.haomeiwen.com/i2818652/43a7793b71d68e48.png)
4.添加Reveal运行脚本
set -e
if [ -n "${CODE_SIGN_IDENTITY}" ]; then
codesign -fs "${CODE_SIGN_IDENTITY}" "${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}/libReveal.dylib"
fi
![](https://img.haomeiwen.com/i2818652/214299e2b195af1c.png)
![](https://img.haomeiwen.com/i2818652/73776bb103de131b.png)
5.添加代码:在AppDelegate.m里面导入头文件
![](https://img.haomeiwen.com/i2818652/01f23f49c183b48a.png)
在
- (void)applicationDidBecomeActive:(UIApplication *)application
方法里面如下图调用方法![](https://img.haomeiwen.com/i2818652/3892350921e8b1c1.png)
- (void)loadReveal
{
if (NSClassFromString(@"IBARevealLoader") == nil)
{
NSString *revealLibName = @"libReveal"; // or @"libReveal-tvOS" for tvOS targets
NSString *revealLibExtension = @"dylib";
NSString *error;
NSString *dyLibPath = [[NSBundle mainBundle] pathForResource:revealLibName ofType:revealLibExtension];
if (dyLibPath != nil)
{
NSLog(@"Loading dynamic library: %@", dyLibPath);
void *revealLib = dlopen([dyLibPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW);
if (revealLib == NULL)
{
error = [NSString stringWithUTF8String:dlerror()];
}
}
else
{
error = @"File not found.";
}
if (error != nil)
{
NSString *message = [NSString stringWithFormat:@"%@.%@ failed to load with error: %@", revealLibName, revealLibExtension, error];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Reveal library could not be loaded"
message:message
preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
[[[[[UIApplication sharedApplication] windows] firstObject] rootViewController] presentViewController:alert animated:YES completion:nil];
}
}
}
6.如果连接Reveal成功打印以下报文
![](https://img.haomeiwen.com/i2818652/0070a6607c990c70.png)
7.我遇到的错误以及注意
![](https://img.haomeiwen.com/i2818652/52e68ffe8bccfa6f.png)
解决方法:将Enable Bitcode修改为NO
![](https://img.haomeiwen.com/i2818652/ad8d30df87daf7b0.png)
提示:真机测试,电脑和手机最好使用同一WiFi或者手机使用电脑创建的WiFi
模拟器部分参考:
[ Reveal在真机和模拟器上的使用]
真机部分参考:
配置reveal实现真机调试项目遇到的坑总结
使用Reveal调试和分析UI
http://www.jianshu.com/p/290af2bf5afb
网友评论