mobile
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesemobile
mobile
Purpose
用途
This skill helps OpenClaw assist in mobile app development by evaluating native (e.g., Swift for iOS, Kotlin for Android) vs. cross-platform (e.g., React Native, Flutter) approaches, ensuring compliance with app store guidelines (e.g., Apple's App Store Review Guidelines, Google Play Policies), and applying mobile UX principles like touch-friendly designs and responsive layouts.
本技能帮助OpenClaw在移动应用开发中提供支持,包括评估原生(如iOS的Swift、Android的Kotlin)与跨平台(如React Native、Flutter)开发方案,确保符合应用商店指南(如苹果App Store审核指南、Google Play政策),并应用移动UX原则(如触控友好设计和响应式布局)。
When to Use
使用场景
Use this skill when starting a new mobile project, refactoring existing apps, or optimizing for platforms; for example, when deciding between native for performance-critical apps or cross-platform for faster development. Apply it during design phases for UX audits or when preparing app submissions to avoid rejections.
在启动新的移动项目、重构现有应用或针对平台进行优化时使用本技能;例如,在决定为性能关键型应用选择原生开发,还是为快速开发选择跨平台开发时。在设计阶段进行UX审核,或准备应用提交以避免被拒时也可使用。
Key Capabilities
核心功能
- Analyze native vs. cross-platform trade-offs: Compare build times, maintenance, and performance using metrics like app size and startup speed.
- Validate against app store guidelines: Check for issues like data privacy compliance (e.g., GDPR alignment) or in-app purchase rules via automated scans.
- Enforce mobile UX principles: Generate recommendations for layouts, such as ensuring button sizes > 44x44 pixels for iOS, or using Material Design components for Android.
- Provide code generation: Output snippets for platform-specific features, like handling permissions in Android Manifest or SwiftUI views.
- Integration with tools: Query external APIs for real-time guideline updates, e.g., fetching Apple guidelines via unofficial scrapers (not recommended for production).
- 分析原生与跨平台的权衡:通过应用大小、启动速度等指标对比构建时间、维护成本和性能。
- 验证应用商店合规性:通过自动化扫描检查数据隐私合规(如GDPR合规)或应用内购买规则等问题。
- 落实移动UX原则:生成布局建议,例如确保iOS按钮尺寸大于44x44像素,或为Android使用Material Design组件。
- 提供代码生成:输出平台特定功能的代码片段,如处理Android Manifest中的权限或SwiftUI视图。
- 工具集成:查询外部API获取指南的实时更新,例如通过非官方爬虫获取苹果指南(不建议用于生产环境)。
Usage Patterns
使用模式
Invoke this skill via OpenClaw's CLI or API by prefixing commands with the skill ID, e.g., . Always pass required parameters like platform and project type. For decisions, use interactive mode to refine inputs based on user feedback. Example: Pipe outputs to other skills for chaining, like combining with a "testing" skill for automated UX tests. Handle asynchronous operations by checking response status codes.
openclaw mobile [subcommand]通过OpenClaw的CLI或API调用本技能,命令前缀需添加技能ID,例如。始终传递必填参数,如平台和项目类型。进行决策时,使用交互模式根据用户反馈优化输入。示例:将输出传递给其他技能进行链式调用,如与“testing”技能结合进行自动化UX测试。通过检查响应状态码处理异步操作。
openclaw mobile [subcommand]Common Commands/API
常用命令/API
Use the OpenClaw CLI for quick tasks or the REST API for programmatic access. Authentication requires setting as an environment variable.
$OPENCLAW_API_KEY-
CLI Command:
openclaw mobile decide --platform ios --type native-vs-cross --factors performance,cost- Output: JSON with pros/cons, e.g., {"native": "Faster performance but higher cost", "cross": "Shared codebase but potential UI inconsistencies"}.
- Code Snippet:
response = subprocess.run(['openclaw', 'mobile', 'decide', '--platform', 'android', '--type', 'cross'], capture_output=True) print(response.stdout.decode())
-
CLI Command:
openclaw mobile validate --app-path /path/to/app --store apple- Flags: (apple/google) for guideline checks;
--storefor local file analysis.--app-path - Code Snippet:
import os os.system('openclaw mobile validate --app-path ./myapp --store google') # Checks for policies like ad compliance and returns exit code 0 if pass
- Flags:
-
API Endpoint: POST /api/v1/skills/mobile/decide
- Body: JSON like {"platform": "ios", "type": "ux-principles", "query": "button sizing"}
- Response: 200 OK with data, e.g., {"recommendation": "Use .frame(width: 50, height: 50) for buttons"}.
- Code Snippet:
import requests headers = {'Authorization': f'Bearer {os.environ.get("OPENCLAW_API_KEY")}'} response = requests.post('https://api.openclaw.ai/api/v1/skills/mobile/decide', json={"platform": "android"}, headers=headers) print(response.json()['advice'])
-
Config Format: Use YAML for custom profiles, e.g.,
mobile: defaultPlatform: android uxRules: minButtonSize: 48Load via:.openclaw mobile config --file path/to/config.yaml
使用OpenClaw CLI完成快速任务,或使用REST API进行程序化访问。认证需要将设置为环境变量。
$OPENCLAW_API_KEY-
CLI命令:
openclaw mobile decide --platform ios --type native-vs-cross --factors performance,cost- 输出:包含优缺点的JSON,例如。
{"native": "性能更快但成本更高", "cross": "代码库共享但可能存在UI不一致"} - 代码片段:
response = subprocess.run(['openclaw', 'mobile', 'decide', '--platform', 'android', '--type', 'cross'], capture_output=True) print(response.stdout.decode())
- 输出:包含优缺点的JSON,例如
-
CLI命令:
openclaw mobile validate --app-path /path/to/app --store apple- 标志:(apple/google)用于指南检查;
--store用于本地文件分析。--app-path - 代码片段:
import os os.system('openclaw mobile validate --app-path ./myapp --store google') # 检查广告合规等政策,通过则返回退出码0
- 标志:
-
API端点:POST /api/v1/skills/mobile/decide
- 请求体:JSON格式,例如
{"platform": "ios", "type": "ux-principles", "query": "button sizing"} - 响应:状态码200 OK并返回数据,例如。
{"recommendation": "使用.frame(width: 50, height: 50)设置按钮"} - 代码片段:
import requests headers = {'Authorization': f'Bearer {os.environ.get("OPENCLAW_API_KEY")}'} response = requests.post('https://api.openclaw.ai/api/v1/skills/mobile/decide', json={"platform": "android"}, headers=headers) print(response.json()['advice'])
- 请求体:JSON格式,例如
-
配置格式:使用YAML创建自定义配置文件,例如:
mobile: defaultPlatform: android uxRules: minButtonSize: 48加载方式:。openclaw mobile config --file path/to/config.yaml
Integration Notes
集成说明
Integrate by wrapping OpenClaw calls in your build scripts or IDE extensions. For example, in a CI/CD pipeline, add a step like before deployment. If using VS Code, install the OpenClaw extension and bind to keyboard shortcuts. For API integrations, ensure is set securely via secrets management. Handle rate limits by caching responses; OpenClaw enforces 100 requests/min, so implement retry logic with exponential backoff.
openclaw mobile validate$OPENCLAW_API_KEY通过在构建脚本或IDE扩展中封装OpenClaw调用实现集成。例如,在CI/CD流水线中,在部署前添加步骤。如果使用VS Code,安装OpenClaw扩展并绑定快捷键。对于API集成,确保通过密钥管理工具安全设置。通过缓存响应处理速率限制;OpenClaw限制每分钟100次请求,因此需实现带指数退避的重试逻辑。
openclaw mobile validate$OPENCLAW_API_KEYError Handling
错误处理
Common errors include authentication failures (HTTP 401) if is missing or invalid—fix by verifying the env var and regenerating keys. For invalid inputs, like unsupported platforms, expect HTTP 400 with details; parse the error JSON and prompt for corrections. Platform-specific issues, e.g., iOS guideline mismatches, return structured errors like {"code": "APP_STORE_101", "message": "Privacy policy missing"}—use try-except blocks in scripts:
$OPENCLAW_API_KEYtry:
result = requests.post(url, headers=headers)
result.raise_for_status()
except requests.exceptions.HTTPError as e:
print(f"Error: {e.response.json()['message']}. Retrying...")Always log errors with timestamps for debugging, and fallback to default behaviors if API is down.
常见错误包括因缺失或无效导致的认证失败(HTTP 401)——解决方法是验证环境变量并重新生成密钥。对于无效输入(如不支持的平台),会返回HTTP 400及详细信息;解析错误JSON并提示用户更正。平台特定问题(如iOS指南不匹配)会返回结构化错误,例如——在脚本中使用try-except块处理:
$OPENCLAW_API_KEY{"code": "APP_STORE_101", "message": "缺少隐私政策"}try:
result = requests.post(url, headers=headers)
result.raise_for_status()
except requests.exceptions.HTTPError as e:
print(f"错误:{e.response.json()['message']}。正在重试...")始终记录带时间戳的错误以便调试,若API不可用则回退到默认行为。
Graph Relationships
关联关系
- Related to: "ios" skill (child node for iOS-specific implementations)
- Related to: "android" skill (sibling node for Android optimizations)
- Connected via: "ux-design" cluster (parent for shared UX principles)
- Links to: "app-store" external resource for guideline references
- 关联:"ios"技能(iOS特定实现的子节点)
- 关联:"android"技能(Android优化的同级节点)
- 所属:"ux-design"集群(共享UX原则的父节点)
- 链接:"app-store"外部资源(指南参考)",