Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Flutterアプリを⾃然⾔語で操作する
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yuki Sakai
June 07, 2025
Technology
440
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Flutterアプリを⾃然⾔語で操作する
Yuki Sakai
June 07, 2025
More Decks by Yuki Sakai
See All by Yuki Sakai
Dart and Flutter MCP serverで実現する AI駆動E2Eテスト整備と自動操作
yukisakai1225
0
3.3k
複雑なドメインに挑む.pdf
yukisakai1225
5
3.4k
Other Decks in Technology
See All in Technology
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
25
16k
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
4
290
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
160
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
240
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
AIエージェントを最高のパートナーに育てる方法|評価と判断軸を育てる5つのステップ
koichiaoki
1
150
俺の仕事は AIに奪われないし、たぶんその BIも要らない
hikaruri
0
510
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.5k
作って終わりじゃないサーバーレス 〜9年運用する大規模EC物流API基盤の設計・運用のリアル〜
zozotech
PRO
0
150
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
170
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
120
映像変換サーバーなしで端末内でHLSを生成してライブ配信
hikarusato
0
130
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
3.2k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Ethics towards AI in product and experience design
skipperchong
2
380
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Everyday Curiosity
cassininazir
0
320
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
420
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Transcript
© LayerX Inc. Flutterアプリを⾃然⾔語で操作する 2025/06/07 Flutter Tokyo #8 酒井佑旗 @yu12k25i
⽬次 Agenda • Mobile MCPとは • Flutterへの応⽤ • デモ
© LayerX Inc. 3 @yu12k25i 株式会社LayerX バクラク事業部 申請経費精算 モバイルアプリチーム この4⽉に新卒⼊社
👶 画像を⼊れてね 酒井佑旗
4 © LayerX Inc. [余談] Claude Codeめっちゃ楽しいですね Read Me 6/5に社内でClaude
Maxが利⽤可能になりClaude Codeデビュー🚗💨
Mobile MCPとは https://github.com/mobile-next/mobile-mcp
6 © LayerX Inc. Mobile MCPとは MCP server for Mobile
Development and Automation モバイル開発と自動化のための MCPサーバー
7 © LayerX Inc. Mobile MCPとは https://github.com/mobile-next/mobile-mcp?tab=readme-ov-file
8 © LayerX Inc. 技術構成 画⾯状態の取得‧操作には各OSの操作ツールを利⽤ - iOS:WebDriverAgent(XCUITest) - Android:ADB
Mobile MCPは操作ツールをラップしている Read Me
9 © LayerX Inc. Mobile MCPの中⾝ Mobile MCPとは mobile_list_available_devices mobile_use_device
mobile_list_apps mobile_launch_app mobile_terminate_app mobile_click_on_screen_at_coordinates mobile_press_button mobile_open_url swipe_on_screen mobile_type_keys mobile_set_orientation mobile_get_screen_size mobile_list_elements_on_screen mobile_take_screenshot mobile_get_orientation デバイス‧アプリ 画⾯情報取得 画⾯操作
10 © LayerX Inc. アプリ操作のサイクル Mobile MCPとは 画⾯の 状態を取得 画⾯操作
現状把握 次のアクション の決定
11 © LayerX Inc. アプリ操作のサイクル Mobile MCPとは 画⾯の 状態を取得 画⾯操作
現状把握 次のアクション の決定 mobile_list_elements_on_screen mobile_take_screenshot mobile_click_on_screen_at_coordinates mobile_press_button swipe_on_screen
12 © LayerX Inc. アプリ操作のサイクル Mobile MCPとは 画⾯の 状態を取得 画⾯操作
現状把握 次のアクション の決定 mobile_list_elements_on_screen mobile_take_screenshot mobile_click_on_screen_at_coordinates mobile_press_button swipe_on_screen 画⾯状態の解釈‧アクションの決定をAIが担う
13 © LayerX Inc. こんな便利なMobile MCP Mobile MCPとは Flutterでは使えないんです!
14 © LayerX Inc. なぜFlutterで使えないのか WebDriverAgent‧ADBではFlutterViewの状態を取得できない - Flutterエンジンのレンダリング結果を専⽤Viewに描画している スクショを正確に解析するにはLLMの能⼒が不⾜ Mobile
MCPとは - アクション対象の要素の位置を正確に推定する能⼒がない - 将来的にはモデル性能の改善で可能になるかも
Flutterへの応⽤
16 © LayerX Inc. Flutterでの現状を整理 Flutterへの応⽤ 画⾯の 状態を取得 画⾯操作 現状把握
次のアクション の決定 mobile_list_elements_on_screen mobile_take_screenshot mobile_click_on_screen_at_coordinates mobile_press_button swipe_on_screen Flutterでは⼀部のtoolsが機能していない
17 © LayerX Inc. 追加対応が必要な箇所は... - スクショベースのアプローチは、LLMの性能不⾜により要素の位置を推定できないので不適 - ウィジェットツリーベースのアプローチでは、要素の正確な位置の取得が可能 [必要]
画⾯状態の取得 [不要] 画⾯操作 Flutterへの応⽤ - 位置指定でのタップ‧スクロールが機能しているので代替不要
18 © LayerX Inc. 画⾯状態取得の代替⽅針 Flutterへの応⽤ Dart VM Serviceを利⽤ -
Dart VMとの通信を担う - 今回はMCP Serverからウィジェットツリーを取得する必要がある - HTTP‧WebSocket経由でアクセス可能なDart VM Serviceが適している セマンティクスな要素のみを取得 - ⽣のウィジェットツリーはサイズが⼤きいので、AIに優しくない - セマンティクスな要素に絞ることでAIに優しいレスポンスとなる
19 © LayerX Inc. ウィジェットツリーをDart VM Serviceから取得する Flutterへの応⽤ オリジナルのDart VM
Service extensionを作成 - WidgetsBinding経由でセマンティクス要素を取得 - ツリー状で取得できるので、ウィジェット位置を計算した上で返却 - ↓ 具体の実装はgistへ https://gist.github.com/yukisakai1225/4c86b821c96f6a5f967312cab550bdef セマンティクス要素の取得 要素の座標を計算 MCP Serverに優しい形に加⼯
20 © LayerX Inc. 動作確認 Flutterへの応⽤ curlを使⽤ - 単発の情報取得なので http通信でok
=== Semantics Widgets === { "label": "", "value": "", "hint": "", "actions": [ "scrollUp" ], "rect": { "left": 0.0, "top": 115.0, "width": 393.0, "height": 643.5 } } { "label": "RefreshIndicatorとRiverpodを組み合わせたプルトゥ リフレッシュ実装。状態管理との連携がスムーズです。 \n#RefreshIndicator\n#Riverpod\n#Async\n#List", "value": "", "hint": "", "actions": [ "tap" ], "rect": { "left": 0.0, "top": 123.0, "width": 393.0, "height": 635.5 } } { "label": "state_manager\n2時間前", レスポンスはJSON - AIが解釈できればJSON出なくても大丈夫 - 要素のラベル、アクション種別、位置などを返却
Demo
22 © LayerX Inc. 対象アプリ Flutterへの応⽤ SNS⾵アプリ - 渾⾝のウィジェットをシェアできる 主な画⾯
- タイムライン - 投稿の詳細画⾯
23 © LayerX Inc. - yamlの⽅が精度は⾼いかも - 今回はMarkdownで⼗分 操作シナリオ Demo
# アプリ操作のシナリオ コメント投稿の動作確認 ## シナリオ - `state_manager`の投稿のユーザー名をタップして、詳細画面に遷移 - コメント用のテキストフィールドに「test」と入力 - 「test」と入力したことを確認 - 「送信ボタン」をタップして、コメントを投稿 - コメントが投稿されたことを確認 ## 注意 - ステップごとにこまめに画面の状態を取得し直すこと Markdownで記載 1. タイムラインから詳細画⾯へ遷移 2. 詳細画⾯でコメントを投稿 流れ
24 © LayerX Inc. Demo
懇親会で応⽤⽅法を 話したいです!