diff --git a/.buildkite/pipeline.full.yml b/.buildkite/pipeline.full.yml index 11a03939a..11b6cd1b1 100644 --- a/.buildkite/pipeline.full.yml +++ b/.buildkite/pipeline.full.yml @@ -84,6 +84,7 @@ steps: plugins: artifacts#v1.3.0: download: ["features/fixtures/macos/output/macOSTestApp.zip"] + upload: ["macOSTestApp.log"] commands: - bundle install - bundle exec maze-runner @@ -103,6 +104,7 @@ steps: plugins: artifacts#v1.3.0: download: ["features/fixtures/macos/output/macOSTestApp.zip"] + upload: ["macOSTestApp.log"] commands: - bundle install - bundle exec maze-runner diff --git a/.buildkite/pipeline.quick.yml b/.buildkite/pipeline.quick.yml index 99d0b9ef3..2f3fd96b6 100644 --- a/.buildkite/pipeline.quick.yml +++ b/.buildkite/pipeline.quick.yml @@ -169,6 +169,7 @@ steps: plugins: artifacts#v1.3.0: download: ["features/fixtures/macos/output/macOSTestApp.zip"] + upload: ["macOSTestApp.log"] commands: - bundle install - bundle exec maze-runner diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b4f68dac8..7484fee04 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -186,6 +186,7 @@ steps: plugins: artifacts#v1.3.0: download: ["features/fixtures/macos/output/macOSTestApp.zip"] + upload: ["macOSTestApp.log"] commands: - bundle install - bundle exec maze-runner diff --git a/.jazzy.yaml b/.jazzy.yaml index 95a33ab88..170080bcb 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -2,11 +2,11 @@ author_url: "https://www.bugsnag.com" author: "Bugsnag Inc" clean: false # avoid deleting docs/.git framework_root: "Bugsnag" -github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.7.0/Bugsnag" +github_file_prefix: "https://github.com/bugsnag/bugsnag-cocoa/tree/v6.7.1/Bugsnag" github_url: "https://github.com/bugsnag/bugsnag-cocoa" hide_documentation_coverage: true module: "Bugsnag" -module_version: "6.7.0" +module_version: "6.7.1" objc: true output: "docs" readme: "README.md" diff --git a/Bugsnag.podspec.json b/Bugsnag.podspec.json index e08bdab70..d0bff7d95 100644 --- a/Bugsnag.podspec.json +++ b/Bugsnag.podspec.json @@ -1,6 +1,6 @@ { "name": "Bugsnag", - "version": "6.7.0", + "version": "6.7.1", "summary": "The Bugsnag crash reporting framework for Apple platforms.", "homepage": "https://bugsnag.com", "license": "MIT", @@ -9,7 +9,7 @@ }, "source": { "git": "https://github.com/bugsnag/bugsnag-cocoa.git", - "tag": "v6.7.0" + "tag": "v6.7.1" }, "frameworks": [ "Foundation", diff --git a/Bugsnag/BugsnagSessionTracker.m b/Bugsnag/BugsnagSessionTracker.m index 6f69caa33..dc4dc6d80 100644 --- a/Bugsnag/BugsnagSessionTracker.m +++ b/Bugsnag/BugsnagSessionTracker.m @@ -123,7 +123,7 @@ - (void)startNewSessionWithAutoCaptureValue:(BOOL)isAutoCaptured { BugsnagApp *app = [BugsnagApp appWithDictionary:@{@"system": systemInfo} config:self.config codeBundleId:self.codeBundleId]; - BugsnagDevice *device = [BugsnagDevice deviceWithDictionary:@{@"system": systemInfo}]; + BugsnagDevice *device = [BugsnagDevice deviceWithKSCrashReport:@{@"system": systemInfo}]; [device appendRuntimeInfo:self.extraRuntimeInfo]; BugsnagSession *newSession = [[BugsnagSession alloc] initWithId:[[NSUUID UUID] UUIDString] diff --git a/Bugsnag/Client/BugsnagClient.m b/Bugsnag/Client/BugsnagClient.m index ba78c190a..5f49ffb27 100644 --- a/Bugsnag/Client/BugsnagClient.m +++ b/Bugsnag/Client/BugsnagClient.m @@ -1031,6 +1031,10 @@ - (void)metadataChanged:(BugsnagMetadata *)metadata { */ #if BSG_PLATFORM_IOS - (void)batteryChanged:(NSNotification *)notification { + if (![UIDEVICE currentDevice]) { + return; + } + NSNumber *batteryLevel = @([UIDEVICE currentDevice].batteryLevel); BOOL charging = [UIDEVICE currentDevice].batteryState == UIDeviceBatteryStateCharging || [UIDEVICE currentDevice].batteryState == UIDeviceBatteryStateFull; @@ -1163,7 +1167,7 @@ - (BugsnagAppWithState *)generateAppWithState:(NSDictionary *)systemInfo { } - (BugsnagDeviceWithState *)generateDeviceWithState:(NSDictionary *)systemInfo { - BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithDictionary:@{@"system": systemInfo}]; + BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithKSCrashReport:@{@"system": systemInfo}]; device.time = [NSDate date]; // default to current time for handled errors [device appendRuntimeInfo:self.extraRuntimeInfo]; device.orientation = _lastOrientation; diff --git a/Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSSystemInfo.m b/Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSSystemInfo.m index 1b747e6b2..35afa7b50 100644 --- a/Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSSystemInfo.m +++ b/Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSSystemInfo.m @@ -371,25 +371,34 @@ + (NSDictionary *)systemInfo { #ifdef __clang_version__ sysInfo[@BSG_KSSystemField_ClangVersion] = @__clang_version__; #endif -#if BSG_HAS_UIDEVICE - sysInfo[@BSG_KSSystemField_SystemName] = [UIDEVICE currentDevice].systemName; - sysInfo[@BSG_KSSystemField_SystemVersion] = [UIDEVICE currentDevice].systemVersion; -#else +#if TARGET_OS_IOS + // Note: This does not match UIDevice.currentDevice.systemName for versions + // prior to (and some versions of) iOS 9 where the systemName was reported + // as "iPhone OS". UIDevice gets its data from MobileGestalt which is a + // private API. /System/Library/CoreServices/SystemVersion.plist contains + // the information we need but will contain the macOS information when + // running on the Simulator. + sysInfo[@BSG_KSSystemField_SystemName] = @"iOS"; +#elif TARGET_OS_OSX sysInfo[@BSG_KSSystemField_SystemName] = @"Mac OS"; +#elif TARGET_OS_TV + sysInfo[@BSG_KSSystemField_SystemName] = @"tvOS"; +#endif NSOperatingSystemVersion version = [NSProcessInfo processInfo].operatingSystemVersion; NSString *systemVersion; if (version.patchVersion == 0) { systemVersion = - [NSString stringWithFormat:@"%ld.%ld", version.majorVersion, - version.minorVersion]; + [NSString stringWithFormat:@"%ld.%ld", + (long)version.majorVersion, (long)version.minorVersion]; } else { - systemVersion = [NSString - stringWithFormat:@"%ld.%ld.%ld", version.majorVersion, - version.minorVersion, version.patchVersion]; + systemVersion = + [NSString stringWithFormat:@"%ld.%ld.%ld", + (long)version.majorVersion, (long)version.minorVersion, + (long)version.patchVersion]; } sysInfo[@BSG_KSSystemField_SystemVersion] = systemVersion; -#endif + if ([self isSimulatorBuild]) { NSString *model = [NSProcessInfo processInfo] .environment[BSGKeySimulatorModelId]; @@ -429,11 +438,11 @@ + (NSDictionary *)systemInfo { sysInfo[@BSG_KSSystemField_DeviceAppHash] = [self deviceAndAppHash]; sysInfo[@BSG_KSSystemField_BuildType] = [BSG_KSSystemInfo buildType]; - NSDictionary *memory = @{ - @BSG_KSSystemField_Size: [self int64Sysctl:@"hw.memsize"], - @BSG_KSCrashField_Usable: @(bsg_ksmachusableMemory()) + sysInfo[@(BSG_KSSystemField_Memory)] = @{ + @(BSG_KSCrashField_Free): @(bsg_ksmachfreeMemory()), + @(BSG_KSCrashField_Usable): @(bsg_ksmachusableMemory()), + @(BSG_KSSystemField_Size): [self int64Sysctl:@"hw.memsize"] }; - sysInfo[@BSG_KSSystemField_Memory] = memory; NSDictionary *statsInfo = [[BSG_KSCrash sharedInstance] captureAppStats]; sysInfo[@BSG_KSCrashField_AppStats] = statsInfo; diff --git a/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c b/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c index fe4aff40e..d9c3903e9 100644 --- a/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c +++ b/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c @@ -38,7 +38,7 @@ #include #include -#if __has_include() && TARGET_OS_IPHONE +#if __has_include() && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST #include #endif @@ -71,7 +71,7 @@ static pthread_t bsg_g_topThread; static size_t (* get_available_memory)(void); static void bsg_ksmachfreeMemory_init(void) { -#if __has_include() && TARGET_OS_IPHONE +#if __has_include() && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST if (__builtin_available(iOS 13.0, tvOS 13.0, watchOS 6.0, *)) { // Only use `os_proc_available_memory` if it appears to be working. // 0 is returned if the calling process is not an app or is running diff --git a/Bugsnag/Payload/BugsnagDevice+Private.h b/Bugsnag/Payload/BugsnagDevice+Private.h index 95b892673..dafd27da8 100644 --- a/Bugsnag/Payload/BugsnagDevice+Private.h +++ b/Bugsnag/Payload/BugsnagDevice+Private.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface BugsnagDevice () -+ (instancetype)deviceWithDictionary:(NSDictionary *)event; ++ (instancetype)deviceWithKSCrashReport:(NSDictionary *)event; + (instancetype)deserializeFromJson:(NSDictionary *)json; diff --git a/Bugsnag/Payload/BugsnagDevice.m b/Bugsnag/Payload/BugsnagDevice.m index 8a99d1c73..d1c124299 100644 --- a/Bugsnag/Payload/BugsnagDevice.m +++ b/Bugsnag/Payload/BugsnagDevice.m @@ -29,7 +29,7 @@ + (BugsnagDevice *)deserializeFromJson:(NSDictionary *)json { return device; } -+ (BugsnagDevice *)deviceWithDictionary:(NSDictionary *)event { ++ (BugsnagDevice *)deviceWithKSCrashReport:(NSDictionary *)event { BugsnagDevice *device = [BugsnagDevice new]; [self populateFields:device dictionary:event]; return device; diff --git a/Bugsnag/Payload/BugsnagDeviceWithState+Private.h b/Bugsnag/Payload/BugsnagDeviceWithState+Private.h index 107234986..9ed790a2c 100644 --- a/Bugsnag/Payload/BugsnagDeviceWithState+Private.h +++ b/Bugsnag/Payload/BugsnagDeviceWithState+Private.h @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)deviceFromJson:(NSDictionary *)json; -+ (instancetype)deviceWithDictionary:(NSDictionary *)event; ++ (instancetype)deviceWithKSCrashReport:(NSDictionary *)event; + (instancetype)deviceWithOomData:(NSDictionary *)data; diff --git a/Bugsnag/Payload/BugsnagDeviceWithState.m b/Bugsnag/Payload/BugsnagDeviceWithState.m index c9d94da0f..8482697e6 100644 --- a/Bugsnag/Payload/BugsnagDeviceWithState.m +++ b/Bugsnag/Payload/BugsnagDeviceWithState.m @@ -97,11 +97,11 @@ + (BugsnagDeviceWithState *)deviceWithOomData:(NSDictionary *)data { return device; } -+ (BugsnagDeviceWithState *)deviceWithDictionary:(NSDictionary *)event { ++ (BugsnagDeviceWithState *)deviceWithKSCrashReport:(NSDictionary *)event { BugsnagDeviceWithState *device = [BugsnagDeviceWithState new]; [self populateFields:device dictionary:event]; device.orientation = [event valueForKeyPath:@"user.state.deviceState.orientation"]; - device.freeMemory = [event valueForKeyPath:@"system.memory.free"] ?: [event valueForKeyPath:@"system.memory.usable"]; + device.freeMemory = [event valueForKeyPath:@"system.memory.free"]; device.freeDisk = BSGDeviceFreeSpace(NSCachesDirectory); NSString *val = [event valueForKeyPath:@"report.timestamp"]; diff --git a/Bugsnag/Payload/BugsnagEvent.m b/Bugsnag/Payload/BugsnagEvent.m index d907b6580..9d4a709d6 100644 --- a/Bugsnag/Payload/BugsnagEvent.m +++ b/Bugsnag/Payload/BugsnagEvent.m @@ -360,7 +360,7 @@ - (instancetype)initWithKSCrashData:(NSDictionary *)event { } } NSString *deviceAppHash = [event valueForKeyPath:@"system.device_app_hash"]; - BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithDictionary:event]; + BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithKSCrashReport:event]; BugsnagUser *user = [self parseUser:event deviceAppHash:deviceAppHash deviceId:device.id]; BugsnagConfiguration *config = [[BugsnagConfiguration alloc] initWithDictionaryRepresentation:[event valueForKeyPath:@"user.config"]]; BugsnagAppWithState *app = [BugsnagAppWithState appWithDictionary:event config:config codeBundleId:self.codeBundleId]; diff --git a/Bugsnag/Payload/BugsnagNotifier.m b/Bugsnag/Payload/BugsnagNotifier.m index 48db4fd3f..d600ea3a2 100644 --- a/Bugsnag/Payload/BugsnagNotifier.m +++ b/Bugsnag/Payload/BugsnagNotifier.m @@ -23,7 +23,7 @@ - (instancetype)init { #else self.name = @"Bugsnag Objective-C"; #endif - self.version = @"6.7.0"; + self.version = @"6.7.1"; self.url = @"https://github.com/bugsnag/bugsnag-cocoa"; self.dependencies = [NSMutableArray new]; } diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ad88ba7f..62ca9f20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ Changelog ========= +## 6.7.1 (2021-03-10) + +### Bug fixes + +* Fix `os_proc_available_memory` runtime link error on Mac Catalyst. + [#1025](https://github.com/bugsnag/bugsnag-cocoa/pull/1025) + +* Fix missing `osName` and `osVersion` for errors reported from app extensions that do not link against UIKit. + [#1022](https://github.com/bugsnag/bugsnag-cocoa/pull/1022) + +* Fix incorrect `freeMemory` for errors reported via `notify()` + [#1021](https://github.com/bugsnag/bugsnag-cocoa/pull/1021) + ## 6.7.0 (2021-03-03) ### Enhancements diff --git a/Framework/Info.plist b/Framework/Info.plist index 427ffc62a..e6e276efb 100644 --- a/Framework/Info.plist +++ b/Framework/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.7.0 + 6.7.1 CFBundleVersion 1 diff --git a/Gemfile.lock b/Gemfile.lock index 7cdb88309..e15809786 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -160,7 +160,7 @@ GEM kramdown (~> 2.0) liferaft (0.0.6) mini_portile2 (2.5.0) - minitest (5.14.3) + minitest (5.14.4) molinillo (0.6.6) multi_json (1.15.0) multi_test (0.1.2) diff --git a/Tests/BugsnagDeviceTest.m b/Tests/BugsnagDeviceTest.m index 3fff062f7..eec068209 100644 --- a/Tests/BugsnagDeviceTest.m +++ b/Tests/BugsnagDeviceTest.m @@ -7,10 +7,10 @@ // #import -#import "BugsnagConfiguration.h" -#import "BugsnagDeviceWithState+Private.h" + +#import "BSG_KSSystemInfo.h" #import "BugsnagDevice+Private.h" -#import "BugsnagTestConstants.h" +#import "BugsnagDeviceWithState+Private.h" @interface BugsnagDeviceTest : XCTestCase @property NSDictionary *data; @@ -49,7 +49,7 @@ - (void)setUp { } - (void)testDevice { - BugsnagDevice *device = [BugsnagDevice deviceWithDictionary:self.data]; + BugsnagDevice *device = [BugsnagDevice deviceWithKSCrashReport:self.data]; // verify stateless fields XCTAssertTrue(device.jailbroken); @@ -69,7 +69,7 @@ - (void)testDevice { } - (void)testDeviceWithState { - BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithDictionary:self.data]; + BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithKSCrashReport:self.data]; // verify stateless fields XCTAssertTrue(device.jailbroken); @@ -98,8 +98,14 @@ - (void)testDeviceWithState { XCTAssertEqualObjects([formatter dateFromString:@"2014-12-02T01:56:13Z"], device.time); } +- (void)testDeviceWithRealSystemInfo { + NSDictionary *systemInfo = [BSG_KSSystemInfo systemInfo]; + BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithKSCrashReport:@{@"system": systemInfo}]; + XCTAssertLessThan(device.freeMemory.unsignedLongLongValue, device.totalMemory.unsignedLongLongValue); +} + - (void)testDeviceToDict { - BugsnagDevice *device = [BugsnagDevice deviceWithDictionary:self.data]; + BugsnagDevice *device = [BugsnagDevice deviceWithKSCrashReport:self.data]; device.locale = @"en-US"; NSDictionary *dict = [device toDictionary]; @@ -122,7 +128,7 @@ - (void)testDeviceToDict { } - (void)testDeviceWithStateToDict { - BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithDictionary:self.data]; + BugsnagDeviceWithState *device = [BugsnagDeviceWithState deviceWithKSCrashReport:self.data]; device.locale = @"en-US"; NSDictionary *dict = [device toDictionary]; @@ -185,7 +191,7 @@ - (void)testDeviceFreeSpaceShouldBeNilWhenFailsToRetrieveIt { } - (void)testDeviceRuntimeInfoAppended { - BugsnagDevice *device = [BugsnagDevice deviceWithDictionary:self.data]; + BugsnagDevice *device = [BugsnagDevice deviceWithKSCrashReport:self.data]; XCTAssertEqual(2, [device.runtimeVersions count]); XCTAssertEqualObjects(@"14B25", device.runtimeVersions[@"osBuild"]); XCTAssertEqualObjects(@"10.0.0 (clang-1000.11.45.5)", device.runtimeVersions[@"clangVersion"]); diff --git a/Tests/BugsnagSessionTest.m b/Tests/BugsnagSessionTest.m index 87063c05f..0e73e213a 100644 --- a/Tests/BugsnagSessionTest.m +++ b/Tests/BugsnagSessionTest.m @@ -84,7 +84,7 @@ - (BugsnagDevice *)generateDevice { } } }; - BugsnagDevice *device = [BugsnagDevice deviceWithDictionary:deviceData]; + BugsnagDevice *device = [BugsnagDevice deviceWithKSCrashReport:deviceData]; device.locale = @"en-US"; return device; } diff --git a/Tests/BugsnagSessionTrackingPayloadTest.m b/Tests/BugsnagSessionTrackingPayloadTest.m index 314f19464..334aeca67 100644 --- a/Tests/BugsnagSessionTrackingPayloadTest.m +++ b/Tests/BugsnagSessionTrackingPayloadTest.m @@ -99,7 +99,7 @@ - (BugsnagDevice *)generateDevice { } } }; - BugsnagDevice *device = [BugsnagDevice deviceWithDictionary:deviceData]; + BugsnagDevice *device = [BugsnagDevice deviceWithKSCrashReport:deviceData]; device.locale = @"en-US"; return device; } diff --git a/Tests/Info.plist b/Tests/Info.plist index 4b7a27186..845465c3d 100644 --- a/Tests/Info.plist +++ b/Tests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 6.7.0 + 6.7.1 CFBundleVersion 1 diff --git a/VERSION b/VERSION index f0e13c509..06a765991 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7.0 +6.7.1 diff --git a/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj b/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj index 2b1f36a9e..35f06d32e 100644 --- a/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj +++ b/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ /* Begin PBXFileReference section */ 0013DB142449E934003DB182 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 00C3ED5723F2D6D800757DBD /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 01CD18D525F7BA4700009EC3 /* Bugsnag Test App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Bugsnag Test App.entitlements"; sourceTree = ""; }; 89117F5055F6B6F9FA00FBEC /* Pods-Bugsnag Test App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bugsnag Test App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Bugsnag Test App/Pods-Bugsnag Test App.debug.xcconfig"; sourceTree = ""; }; 8A4882E1224BCC130035B94C /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 8A4882E3224BCD5D0035B94C /* OutOfMemoryController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OutOfMemoryController.h; sourceTree = ""; }; @@ -122,6 +123,7 @@ F40B875016AA233500676BB2 /* Bugsnag Test App */ = { isa = PBXGroup; children = ( + 01CD18D525F7BA4700009EC3 /* Bugsnag Test App.entitlements */, A1F5109A249A5C4000AFF4DE /* CxxException.h */, A1F51099249A5C4000AFF4DE /* CxxException.mm */, F40B875916AA233500676BB2 /* AppDelegate.h */, @@ -391,6 +393,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Bugsnag Test App/Bugsnag Test App.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; @@ -408,6 +411,7 @@ PROVISIONING_PROFILE = ""; SEPARATE_STRIP = YES; STRIP_INSTALLED_PRODUCT = YES; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 4.0; WRAPPER_EXTENSION = app; }; @@ -419,6 +423,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Bugsnag Test App/Bugsnag Test App.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEPLOYMENT_POSTPROCESSING = YES; @@ -434,6 +439,7 @@ PROVISIONING_PROFILE = ""; SEPARATE_STRIP = YES; STRIP_INSTALLED_PRODUCT = YES; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 4.0; WRAPPER_EXTENSION = app; }; diff --git a/examples/objective-c-ios/Bugsnag Test App/Bugsnag Test App.entitlements b/examples/objective-c-ios/Bugsnag Test App/Bugsnag Test App.entitlements new file mode 100644 index 000000000..ee95ab7e5 --- /dev/null +++ b/examples/objective-c-ios/Bugsnag Test App/Bugsnag Test App.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/features/app_and_device_attributes.feature b/features/app_and_device_attributes.feature index 9f886a23a..c91d9a75e 100644 --- a/features/app_and_device_attributes.feature +++ b/features/app_and_device_attributes.feature @@ -35,6 +35,7 @@ Feature: App and Device attributes present | ios | @not_null | | macos | @null | And the error payload field "events.0.device.time" is a date + And the event "device.freeMemory" is less than the event "device.totalMemory" # App diff --git a/features/barebone_tests.feature b/features/barebone_tests.feature index 0a1375666..d3d30441e 100644 --- a/features/barebone_tests.feature +++ b/features/barebone_tests.feature @@ -28,6 +28,7 @@ Feature: Barebone tests And the event "app.version" equals "12.3" And the event "breadcrumbs.0.name" equals "Running BareboneTestHandledScenario" And the event "breadcrumbs.1.name" equals "This is super " + And the event "device.freeMemory" is less than the event "device.totalMemory" And the event "device.id" is not null And the event "device.jailbroken" is false And the event "device.locale" is not null @@ -119,6 +120,7 @@ Feature: Barebone tests And the event "app.version" equals "12.3" And the event "breadcrumbs.0.name" equals "Bugsnag loaded" And the event "breadcrumbs.1.name" is null + And the event "device.freeMemory" is less than the event "device.totalMemory" And the event "device.id" is not null And the event "device.jailbroken" is false And the event "device.locale" is not null diff --git a/features/steps/ios_steps.rb b/features/steps/ios_steps.rb index 600024aa3..0a01050c1 100644 --- a/features/steps/ios_steps.rb +++ b/features/steps/ios_steps.rb @@ -169,6 +169,14 @@ def request_fields_are_equal(key, index_a, index_b) assert_true(lower <= value && value <= upper, "Expected a value between #{lower} and #{upper}, but received #{value}") end +Then('the event {string} is less than the event {string}') do |field1, field2| + value1 = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], "events.0.#{field1}") + assert_not_nil(value1, 'Expected a value') + value2 = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], "events.0.#{field2}") + assert_not_nil(value2, 'Expected a value') + assert_true(value1 < value2, "Expected value to be less than #{value2}, but received #{value1}") +end + Then('the event breadcrumbs contain {string} with type {string}') do |string, type| crumbs = Maze::Helper.read_key_path(find_request(0)[:body], 'events.0.breadcrumbs') assert_not_equal(0, crumbs.length, 'There are no breadcrumbs on this event')