diff --git a/Core/GrowingAPM.h b/Core/GrowingAPM.h index f3ad5e0..dc06ad0 100644 --- a/Core/GrowingAPM.h +++ b/Core/GrowingAPM.h @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN + (void)startWithConfig:(GrowingAPMConfig *)config; -+ (void)swizzle:(GrowingAPMMonitors)monitors; ++ (void)setupMonitors:(GrowingAPMMonitors)monitors appDelegateClass:(Class)appDelegateClass; @end diff --git a/Core/GrowingAPM.m b/Core/GrowingAPM.m index 2c43bc1..e201b23 100644 --- a/Core/GrowingAPM.m +++ b/Core/GrowingAPM.m @@ -61,10 +61,6 @@ @interface GrowingAPM () @property (nonatomic, strong, readwrite) id pageLoadMonitor; @property (nonatomic, strong, readwrite) id networkMonitor; -#ifdef GROWING_APM_UI -@property (nonatomic, assign) double coldRebootBeginTime; -#endif - #ifdef GROWING_APM_CRASH @property (class, nonatomic, weak) GrowingCrashInstallation *crashInstallation; #endif @@ -97,7 +93,6 @@ + (void)startWithConfig:(GrowingAPMConfig *)config { if (config.monitors & GrowingAPMMonitorsUserInterface) { #ifdef GROWING_APM_UI GrowingAPMUIMonitor *monitor = [GrowingAPMUIMonitor sharedInstance]; - monitor.coldRebootBeginTime = apm.coldRebootBeginTime; [monitor startMonitor]; apm.pageLoadMonitor = (id )monitor; #endif @@ -118,12 +113,12 @@ + (void)startWithConfig:(GrowingAPMConfig *)config { } } -+ (void)swizzle:(GrowingAPMMonitors)monitors { ++ (void)setupMonitors:(GrowingAPMMonitors)monitors appDelegateClass:(Class)appDelegateClass { if (monitors & GrowingAPMMonitorsUserInterface) { #ifdef GROWING_APM_UI [GrowingAppLifecycle setup]; - [GrowingAPMUIMonitor setup]; - GrowingAPM.sharedInstance.coldRebootBeginTime = GrowingTimeUtil.currentSystemTimeMillis; + GrowingAPMUIMonitor.mainStartTime = GrowingTimeUtil.currentSystemTimeMillis; + [GrowingAPMUIMonitor setup:appDelegateClass]; #endif } diff --git a/Core/GrowingAPMMonitor.h b/Core/GrowingAPMMonitor.h index 141ac24..22f052d 100644 --- a/Core/GrowingAPMMonitor.h +++ b/Core/GrowingAPMMonitor.h @@ -29,7 +29,6 @@ NS_ASSUME_NONNULL_BEGIN @optional + (instancetype)sharedInstance; -+ (void)setup; @end diff --git a/CrashMonitor/GrowingAPMCrashMonitor.xcframework/Info.plist b/CrashMonitor/GrowingAPMCrashMonitor.xcframework/Info.plist index 8e0de14..efbb49d 100644 --- a/CrashMonitor/GrowingAPMCrashMonitor.xcframework/Info.plist +++ b/CrashMonitor/GrowingAPMCrashMonitor.xcframework/Info.plist @@ -6,32 +6,32 @@ LibraryIdentifier - ios-arm64_armv7 + ios-arm64_i386_x86_64-simulator LibraryPath GrowingAPMCrashMonitor.framework SupportedArchitectures arm64 - armv7 + i386 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator LibraryIdentifier - ios-arm64_i386_x86_64-simulator + ios-arm64_armv7 LibraryPath GrowingAPMCrashMonitor.framework SupportedArchitectures arm64 - i386 - x86_64 + armv7 SupportedPlatform ios - SupportedPlatformVariant - simulator CFBundlePackageType diff --git a/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_armv7/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor b/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_armv7/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor index 94de36c..6fc9009 100644 Binary files a/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_armv7/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor and b/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_armv7/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor differ diff --git a/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor b/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor index 5c2014c..86e763f 100644 Binary files a/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor and b/CrashMonitor/GrowingAPMCrashMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMCrashMonitor.framework/GrowingAPMCrashMonitor differ diff --git a/GrowingAPM.podspec b/GrowingAPM.podspec index 9245d76..df9b23d 100644 --- a/GrowingAPM.podspec +++ b/GrowingAPM.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GrowingAPM' - s.version = '0.0.2' + s.version = '0.0.3' s.summary = 'iOS SDK of GrowingIO.' s.description = <<-DESC GrowingAPM提供移动端性能采集分析功能,包括崩溃分析、启动分析、页面加载分析等。 diff --git a/README.md b/README.md index ba3b5b9..2d27c15 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,13 @@ pod 'GrowingAPM/CrashMonitor' #import "GrowingAPM.h" ``` -- 在 main 函数中,添加如下代码 (此操作仅为了尽可能地在 App 运行前 Swizzle,除必要的崩溃日志本地缓存外,不会生成、上报数据): +- 在 main 函数中,添加如下代码 (此操作仅为了尽可能地在 App 运行前开启监测,除必要的崩溃日志本地缓存外,不会生成、上报数据): ```objc int main(int argc, char * argv[]) { // GrowingAPM Swizzle - [GrowingAPM swizzle:GrowingAPMMonitorsCrash | GrowingAPMMonitorsUserInterface]; + [GrowingAPM setupMonitors:GrowingAPMMonitorsCrash | GrowingAPMMonitorsUserInterface + appDelegateClass:[AppDelegate class]]; NSString * appDelegateClassName; @autoreleasepool { // Setup code that might create autoreleased objects goes here. diff --git a/UIMonitor/GrowingAPMUIMonitor.xcframework/Info.plist b/UIMonitor/GrowingAPMUIMonitor.xcframework/Info.plist index 1a9f876..c80a1d7 100644 --- a/UIMonitor/GrowingAPMUIMonitor.xcframework/Info.plist +++ b/UIMonitor/GrowingAPMUIMonitor.xcframework/Info.plist @@ -6,32 +6,32 @@ LibraryIdentifier - ios-arm64_armv7 + ios-arm64_i386_x86_64-simulator LibraryPath GrowingAPMUIMonitor.framework SupportedArchitectures arm64 - armv7 + i386 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator LibraryIdentifier - ios-arm64_i386_x86_64-simulator + ios-arm64_armv7 LibraryPath GrowingAPMUIMonitor.framework SupportedArchitectures arm64 - i386 - x86_64 + armv7 SupportedPlatform ios - SupportedPlatformVariant - simulator CFBundlePackageType diff --git a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor index d3003b9..78e786b 100644 Binary files a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor and b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor differ diff --git a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h index 040fe78..9ebacf0 100644 --- a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h +++ b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_armv7/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h @@ -26,10 +26,11 @@ typedef void(^GrowingAPMUIMonitorBlock)(NSString *pageName, double loadDuration, @interface GrowingAPMUIMonitor : NSObject @property (nonatomic, copy) GrowingAPMUIMonitorBlock monitorBlock; -@property (nonatomic, assign) double coldRebootBeginTime; + +@property (class, nonatomic, assign) double mainStartTime; + (instancetype)sharedInstance; -+ (void)setup; ++ (void)setup:(Class)appDelegateClass; - (void)startMonitor; @end diff --git a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor index 37024c4..dbcd5eb 100644 Binary files a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor and b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/GrowingAPMUIMonitor differ diff --git a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h index 040fe78..9ebacf0 100644 --- a/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h +++ b/UIMonitor/GrowingAPMUIMonitor.xcframework/ios-arm64_i386_x86_64-simulator/GrowingAPMUIMonitor.framework/Headers/GrowingAPMUIMonitor.h @@ -26,10 +26,11 @@ typedef void(^GrowingAPMUIMonitorBlock)(NSString *pageName, double loadDuration, @interface GrowingAPMUIMonitor : NSObject @property (nonatomic, copy) GrowingAPMUIMonitorBlock monitorBlock; -@property (nonatomic, assign) double coldRebootBeginTime; + +@property (class, nonatomic, assign) double mainStartTime; + (instancetype)sharedInstance; -+ (void)setup; ++ (void)setup:(Class)appDelegateClass; - (void)startMonitor; @end