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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
1
3.3k
複雑なドメインに挑む.pdf
yukisakai1225
5
3.5k
Other Decks in Technology
See All in Technology
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
110
AIがコードを書く時代に、エンジニアは何で自分の価値を証明するのか / In an era where AI writes code how do engineers prove their value
carta_engineering
1
680
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
580
More Freedom on the Same Shared GPU Cluster: A Small Team’s Experience with vCluster
nttcom
0
140
AI時代のPRレビューにどう向き合うか?
kairim0
1
120
自律型 AI をセキュアに実装!Gemini と MIG で作る動的コード実行環境
recruitengineers
PRO
1
230
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
12 個 Tool と、 4,096 Token
hlum
0
110
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
120
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
390
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
4
1.1k
自作バイナリを動かす「入口」8選
puhitaku
1
1.2k
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
860
Code Reviewing Like a Champion
maltzj
529
40k
Unsuck your backbone
ammeep
672
58k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
450
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
300
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Crafting Experiences
bethany
1
380
The Pragmatic Product Professional
lauravandoore
37
7.5k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
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
懇親会で応⽤⽅法を 話したいです!