Blacksmith
Automated ASC screenshots within Xcode
Install / Use
/learn @chFlorian/BlacksmithREADME
Blacksmith
Support the project: <a href='https://ko-fi.com/W7W14R38E' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi2.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
Previously distributed through: <a href='https://flowritescode.gumroad.com/l/blacksmith?layout=profile'>Gumroad ($0+)</a>
Automated and localized App Store Screenshots without leaving Xcode.
Installation Instructions
Blacksmith supports installation via Swift Package Manager. To install, add the package via this url:
https://github.com/chFlorian/Blacksmith
Usage
Blacksmith is used to automatically generated simple App Store screenshots for multiple localizations.
1. Add Blacksmith to your UITest target & import Blacksmith
import Blacksmith
import XCTest
import SwiftUI
class ForgeUITests: XCTestCase {
2. Create a testX function for each screen/locale that you want to create an image of
func testScreenshot_AddElementToLayoutBuilder() throws {
let app = XCUIApplication()
3. Specify a language that should be used for the export
app.launchArguments = ["-AppleLanguages", "(en)"]
app.launch()
4. Navigate to the screen that should be exported
let window = app.windows.firstMatch
window.outlines.buttons["🛠 Layout Builder"].click()
let addElementButton = window.toolbars.buttons["Add Element"]
addElementButton.click()
5. Create a screenshot
let screenshot = app.screenshot()
5. (A) Use the quickExportWithTitle function on screenshot
You can either use quickExportWithTitle directly on the XCUIScreenshot or follow step 6 and 7
6. Setup a Capturing View
let exportSize = ExportSize.mac
let capturingView = ScreenshotWithTitle(
title: "Create your own image layouts.",
image: screenshot.image,
background: .color(.blue),
exportSize: .mac
)
7. Choose a location to export the image
let url = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("result.png")
exportMarketing(image: capturingView, toURL: url)
8. Clean up
app.terminate()
}
}
Full Code Example:
import Blacksmith
import XCTest
import SwiftUI
class ForgeUITests: XCTestCase {
func testExample() throws {
let app = XCUIApplication()
app.launchArguments = ["-AppleLanguages", "(en)"]
app.launch()
let window = XCUIApplication().windows.firstMatch
window.outlines.buttons["🛠 Layout Builder"].click()
let addElementButton = window.toolbars.buttons["Add Element"]
addElementButton.click()
let screenshot = app.screenshot()
let exportSize = ExportSize.mac
let capturingView = ScreenshotWithTitle(
title: "Create your own image layouts.",
image: screenshot.image,
background: .color(.blue),
exportSize: .mac
)
let url = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("result.png")
exportMarketing(image: capturingView, toURL: url)
app.terminate()
}
}
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
