用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/rodydavis/skills --skill flutter-control-and-screenshot命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | flutter-control-and-screenshot |
| description | Guide on how to control a Flutter app using flutter_driver via MCP and capture screenshots. |
This skill outlines the process of adding flutter_driver support to a Flutter application, launching it via the Dart MCP server, controlling it (tapping, finding widgets), and capturing screenshots (handling Web/Desktop specific constraints).
dart-mcp-server is active.Add flutter_driver to the dev_dependencies in your pubspec.yaml.
dev_dependencies:
flutter_driver:
sdk: flutter
Run dart pub get or use the mcp_dart-mcp-server_pub tool.
Create a separate entry point, typically test_driver/app.dart, to enable the driver extension without polluting main.dart.
[!IMPORTANT] Replace
your_app_package_namewith the actual name of your package as defined inpubspec.yaml.
// test_driver/app.dart
import 'package:flutter_driver/driver_extension.dart';
import 'package:your_app_package_name/main.dart' as app; // Import your main app
void main() {
// Enable the extension
enableFlutterDriverExtension();
// Run the app
app.main();
}
Use the mcp_dart-mcp-server_launch_app tool.
target: test_driver/app.dartdevice: chrome (or macos, linux, windows)root: Absolute path to your project root.Note: The tool returns a DTD URI (Data Tooling Daemon) and a PID. Save these.
Use mcp_dart-mcp-server_connect_dart_tooling_daemon with the URI returned from the launch step.
{
"uri": "ws://127.0.0.1:..."
}
If running on Web (Chrome), flutter_driver's screenshot command may not work or may not be supported directly in all environments. A robust fallback is to use the browser_subagent.
mcp_dart-mcp-server_get_app_logs with the app's PID. Look for lines like A Dart VM Service on Chrome is available at: http://127.0.0.1:XXXXX. The app logs usually contain the local HTTP URL.browser_subagent.
Use mcp_dart-mcp-server_flutter_driver to interact with the app.
mcp_dart-mcp-server_get_widget_tree (useful to find keys/labels).{
"command": "tap",
"finderType": "ByText",
"text": "Settings"
}
Always stop the app when done to free up ports and resources.
mcp_dart-mcp-server_stop_app with the PID.test_driver/app.dart.