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靜態庫添加到工程中。
模擬器 圖1
3.靜態庫引用設置。
模擬器 圖2
4.添加系統依賴庫。
模擬器 圖3
5.打開Reveal并選擇設備運行模擬器.
模擬器 圖4
真機###
1.獲取libReveal.dylib庫
真機1
2.將庫添加到Reveal項目中:注意不要 Add to targets:Reveal
.
真機2
真機3
3.添加系統依賴庫:CFNetwork.framework
,QuartzCore.framework
,CoreGraphics.framework
真機4
4.添加Reveal運行腳本
set -e
if [ -n "${CODE_SIGN_IDENTITY}" ]; then
codesign -fs "${CODE_SIGN_IDENTITY}" "${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}/libReveal.dylib"
fi
真機5
真機6
5.添加代碼:在AppDelegate.m里面導入頭文件
真機7
在
- (void)applicationDidBecomeActive:(UIApplication *)application
方法里面如下圖調用方法真機8
- (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成功打印以下報文
真機9
7.我遇到的錯誤以及注意
真機10
解決方法:將Enable Bitcode修改為NO
真機11
提示:真機測試,電腦和手機最好使用同一WiFi或者手機使用電腦創建的WiFi
模擬器部分參考:
[ Reveal在真機和模擬器上的使用]
真機部分參考:
配置reveal實現真機調試項目遇到的坑總結
使用Reveal調試和分析UI
http://www.lxweimin.com/p/290af2bf5afb