Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Xcode & fastlane で iOS アプリのスクショ撮影を自動化しよう!
Search
Tomoki Kobayashi
August 20, 2018
Technology
3
1k
Xcode & fastlane で iOS アプリのスクショ撮影を自動化しよう!
Nagoya iOS meetup Vol.4 での発表資料です。
https://nagoya-ios-meetup.connpass.com/event/95974/
Tomoki Kobayashi
August 20, 2018
Tweet
Share
More Decks by Tomoki Kobayashi
See All by Tomoki Kobayashi
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
310
Liquid Glass を Metal Shader で描きたいだけの人生だった…
temoki
0
12
Skip Skip Run Run Run ♫
temoki
0
640
さようならRxSwift こんにちは*****
temoki
1
390
Androidで不安定なPlatform Viewsとの闘い
temoki
0
900
iOSパッケージマネージャー奮闘記 完結編
temoki
2
590
事業譲渡を受けたアプリとの統合で失敗、 そしてユーザーからの評価回復に至るまで
temoki
1
640
Apple Vision Proデベロッパラボに参加してきた
temoki
0
490
年末年始の成果、そして現状の紹介
temoki
0
210
Other Decks in Technology
See All in Technology
なぜテストマネージャの視点が 必要なのか? 〜 一歩先へ進むために 〜
moritamasami
0
220
Webブラウザ向け動画配信プレイヤーの 大規模リプレイスから得た知見と学び
yud0uhu
0
230
2つのフロントエンドと状態管理
mixi_engineers
PRO
3
110
自作JSエンジンに推しプロポーザルを実装したい!
sajikix
1
180
OCI Oracle Database Services新機能アップデート(2025/06-2025/08)
oracle4engineer
PRO
0
140
研究開発と製品開発、両利きのロボティクス
youtalk
1
520
DDD集約とサービスコンテキスト境界との関係性
pandayumi
3
280
まずはマネコンでちゃちゃっと作ってから、それをCDKにしてみよか。
yamada_r
2
100
現場で効くClaude Code ─ 最新動向と企業導入
takaakikakei
1
240
Webアプリケーションにオブザーバビリティを実装するRust入門ガイド
nwiizo
7
820
5分でカオスエンジニアリングを分かった気になろう
pandayumi
0
240
開発者を支える Internal Developer Portal のイマとコレカラ / To-day and To-morrow of Internal Developer Portals: Supporting Developers
aoto
PRO
1
460
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
96
6.2k
Navigating Team Friction
lara
189
15k
Music & Morning Musume
bryan
46
6.8k
Gamification - CAS2011
davidbonilla
81
5.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
51
5.6k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
Transcript
Xcode & fastlane iOS iOS meetup Nagoya
@temoki Fenrir Inc. / PL, iOS Engineer Mobile Act NAGOYA
/
VanApp Fenrir Van = Fenrir
Fenrir VanApp iOS https://vanapp.com/dokidokiglass
Swift (2015 ) ObjectiveC Swift4 iPhone X
1. UI 2. UI Accessibility Identifier 3. UI 4.
UI Xcode 7 UI Test Unit Test UI Test
Accessibility Identifier UI Storyboard Accessibility Identifier
class UITestsForScreenshot: XCTestCase { override func setUp() { super.setUp() }
override func tearDown() { super.tearDown() } func testForScreenshot() { // UI }
// let app = XCUIApplication() app.launch() // UI Accessibility Identifier
let glassButton = app.buttons["glass-button"].firstMatch let sensorButton = app.buttons["sensor-button"].firstMatch // glassButton.tap() sensorButton.tap()
// // let tap3Button = app.buttons["tap3_button"].firstMatch expectation(for: NSPredicate(format: "exists ==
true"), evaluatedWith: tap3Button, handler: nil) waitForExpectations(timeout: 30, handler: nil) // 10 for _ in 1...10 { tap3Button.tap() }
None
UI UI // let screenshot = XCUIScreen.main.screenshot() // let attachment
= XCTAttachment(screenshot: screenshot) attachment.lifetime = .keepAlways add(attachment)
Report Navigator
(1)
None
fastlane snapshot fastlane iOS/Android snapshot https://github.com/fastlane/fastlane
( ) 1. UI 2. UI Accessibility Identifier 3. UI
4. fastlane snapshot 5. UI Snapshot 6. fastlane snapshot
fastlane snapshot RubyGems fastlane Xcode snapshot Snapfile, SnapshotHelper.swift $ sudo
gem install fastlane --verbose $ fastlane snapshot init Snapfile # devices(["iPhone 8","iPhone 8 Plus","iPhone X","iPhone SE"]) # languages(["ja-jP"])
snapshot SnapshotHelper.swift UI let app = XCUIApplication() // snapshot setupSnapshot(app)
// ) snapshot("01_Connection ")
(2)
None
UI UI app.launchArguments.append("SCREENSHOT") ProcessInfo ProcessInfo.processInfo.arguments.contains("SCREENSHOT") UI
UI ( )
UIViewController view Accessibility Identifier otherElements view // .otherElements view let
view = app.otherElements["connection-view"].firstMatch // view expectation(for: NSPredicate(format: "exists == true"), evaluatedWith: element, handler: nil) waitForExpectations(timeout: 30, handler: nil)
$ fastlane snapshot ( + snapshot )
fastlane frameit (iPhone Plus) ( X )