这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
options.profilesSampleRate = 1.0
options.attachScreenshot = true
options.attachViewHierarchy = true
options.environment = "test-app"
options.enableTimeToFullDisplayTracing = true
options.enablePerformanceV2 = true

Expand Down Expand Up @@ -65,7 +64,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

options.initialScope = { scope in
scope.setEnvironment("debug")
let processInfoEnvironment = ProcessInfo.processInfo.environment["io.sentry.sdk-environment"]

if processInfoEnvironment != nil {
scope.setEnvironment(processInfoEnvironment)
} else if isBenchmarking {
scope.setEnvironment("benchmarking")
} else {
scope.setEnvironment("debug")
}

scope.setTag(value: "swift", key: "language")

let user = User(userId: "1")
Expand Down
1 change: 1 addition & 0 deletions Samples/iOS-Swift/iOS-SwiftUITests/BaseUITest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class BaseUITest: XCTestCase {
continueAfterFailure = false
XCUIDevice.shared.orientation = .portrait
app.launchEnvironment["io.sentry.ui-test.test-name"] = name
app.launchEnvironment["io.sentry.sdk-environment"] = "ui-tests"
app.launch()

waitForExistenceOfMainScreen()
Expand Down