From ffd31f60f9ae93e33a24b0794514b7e45c1a30d1 Mon Sep 17 00:00:00 2001 From: Stefan Herold Date: Tue, 31 Aug 2021 00:40:43 +0200 Subject: [PATCH 1/3] Add additional log output --- Sources/Core/Simulator/Simctl.swift | 17 +++++++++++++++-- Sources/Snap/commands/sub/Run.swift | 3 +-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Sources/Core/Simulator/Simctl.swift b/Sources/Core/Simulator/Simctl.swift index 8cb5f0e..0c2927b 100644 --- a/Sources/Core/Simulator/Simctl.swift +++ b/Sources/Core/Simulator/Simctl.swift @@ -62,13 +62,24 @@ public extension Simctl { return deviceIDs } + static func killAllSimulators(logInset: Int = 0) { + Logger.shared.info("Killing all open simulators", inset: logInset) + + run(bash: "killall Simulator") + run(bash: "killall iPhone Simulator") + } + static func createDevice(name: String, id: String, runtime: Runtime) throws -> String { + Logger.shared.info("Create device \(id) with name \"\(name)\" and runtime \(runtime)", inset: 1) + let deviceId = try Simctl.createDevice(name: name, id: id, runtime: runtime) return deviceId } static func updateStyle(_ style: Style, deviceIds: [String]) throws { try deviceIds.forEach { + Logger.shared.info("Set style \(style) for devices \(deviceIds)", inset: 1) + try _boot(deviceId: $0) try _setAppearance(for: $0, style: style) } @@ -76,6 +87,8 @@ public extension Simctl { static func updateStatusBar(deviceIds: [String]) throws { try deviceIds.forEach { + Logger.shared.info("Set statusbar for devices \(deviceIds)", inset: 1) + try _boot(deviceId: $0) try _updateStatusBar(deviceId: $0) } @@ -93,7 +106,7 @@ public extension Simctl { let screensURL = currentURL.appendingPathComponent("screens") let testPlanName = "\(scheme)-Screenshots" - Logger.shared.info("Running test plan for scheme '\(scheme)' and style '\(style)'. Test plan name expected: \(testPlanName)", inset: 1) + Logger.shared.info("Running test plan '\(testPlanName)' for scheme '\(scheme)' and style '\(style)'", inset: 1) // This command just needs the binaries and the path to the xctestrun file created before the actual // testing. There everything can be configured to run the tests without needing the source code, @@ -106,7 +119,7 @@ public extension Simctl { testPlan: testPlanName, resultsBundleURL: resultsBundleURL) - Logger.shared.info("Extracting screenshots from xcresult bundle '\(resultsBundleURL.path)' for scheme '\(scheme)' and style '\(style)'", inset: 1) + Logger.shared.info("Extracting screenshots from xcresult bundle '\(resultsBundleURL.path)' for scheme '\(scheme)' and style '\(style)'", inset: 2) try FileManager.default.createDirectory(at: screensURL, withIntermediateDirectories: true, attributes: nil) try Mint.screenshots(resultsBundleURL: resultsBundleURL, screensURL: screensURL) diff --git a/Sources/Snap/commands/sub/Run.swift b/Sources/Snap/commands/sub/Run.swift index 44c97a4..6102b5c 100644 --- a/Sources/Snap/commands/sub/Run.swift +++ b/Sources/Snap/commands/sub/Run.swift @@ -111,8 +111,7 @@ extension Snap { """ Logger.shared.info(configMessage) - Logger.shared.info("Killing all open simulators") - SwiftShell.run("killall", ["simulator"]) + Simctl.killAllSimulators() Logger.shared.info("Finding runtime for platform \(platform)") let runtime = try Simctl.runtimeForPlatform(platform) From 2526bdbdba7b5de7cbeb1faebd8e5fe23a2fef4c Mon Sep 17 00:00:00 2001 From: Stefan Herold Date: Tue, 31 Aug 2021 13:07:07 +0200 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1b7ac3..e5ee775 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +* Add more log statements - [@blackjacx](https://github.com/blackjacx). ## [0.0.8] - 2021-08-30Z * Specify zipFileName for Snap (https://github.com/Blackjacx/Assist/commit/a10d0f9f561de2d62d1aceace20a09a4a13a503a) - [@blackjacx](https://github.com/blackjacx). From b8b0001e2e9560ba38e261d300d6e6eee00c334a Mon Sep 17 00:00:00 2001 From: Stefan Herold Date: Tue, 31 Aug 2021 13:07:22 +0200 Subject: [PATCH 3/3] Fastlane: Release on Production 0.0.9 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5ee775..fe3e154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] + +## [0.0.9] - 2021-08-31Z * Add more log statements - [@blackjacx](https://github.com/blackjacx). ## [0.0.8] - 2021-08-30Z