移动应用开发
mobile-development
使用 React Native、Flutter、Swift/SwiftUI 和 Kotlin/Jetpack Compose 构建现代移动应用。涵盖移动优先的设计原则、性能优化(电量、内存、网络)、离线优先架构、平台专属规范(iOS HIG、Material Design)、测试策略、安全最佳实践、无障碍访问、应用商店上架以及移动开发思维。当构建移动应用、实现移动端 UX 模式、针对移动端限制条件进行优化,或在原生与跨平台方案之间做决策时使用。
- License 许可
- MIT
- 最近更新
- 2025-12-10
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- mobile-development
- license
- MIT
- version
- 1.0.0
- description
- Build modern mobile applications with React Native, Flutter, Swift/SwiftUI, and Kotlin/Jetpack Compose. Covers mobile-first design principles, performance optimization (battery, memory, network), offline-first architecture, platform-specific guidelines (iOS HIG, Material Design), testing strategies, security best practices, accessibility, app store deployment, and mobile development mindset. Use when building mobile apps, implementing mobile UX patterns, optimizing for mobile constraints, or making native vs cross-platform decisions.
02 资源文件 6
- 参考文档references/mobile-android.md13.7 KB
- 参考文档references/mobile-best-practices.md12.4 KB
- 参考文档references/mobile-debugging.md21.1 KB
- 参考文档references/mobile-frameworks.md13.7 KB
- 参考文档references/mobile-ios.md10.3 KB
- 参考文档references/mobile-mindset.md15.7 KB
03 SKILL.md 正文
Mobile Development Skill
Production-ready mobile development with modern frameworks, best practices, and mobile-first thinking patterns.
When to Use
- Building mobile applications (iOS, Android, or cross-platform)
- Implementing mobile-first design and UX patterns
- Optimizing for mobile constraints (battery, memory, network, small screens)
- Making native vs cross-platform technology decisions
- Implementing offline-first architecture and data sync
- Following platform-specific guidelines (iOS HIG, Material Design)
- Optimizing mobile app performance and user experience
- Implementing mobile security and authentication
- Testing mobile applications (unit, integration, E2E)
- Deploying to App Store and Google Play
Technology Selection Guide
Cross-Platform Frameworks:
- React Native: JavaScript expertise, web code sharing, mature ecosystem (121K stars, 67% familiarity)
- Flutter: Performance-critical apps, complex animations, fastest-growing (170K stars, 46% adoption)
Native Development:
- iOS (Swift/SwiftUI): Maximum iOS performance, latest features, Apple ecosystem integration
- Android (Kotlin/Jetpack Compose): Maximum Android performance, Material Design 3, platform optimization
See: references/mobile-frameworks.md for detailed framework comparisons
Mobile Development Mindset
The 10 Commandments of Mobile Development:
- Performance is Foundation, Not Feature - 70% abandon apps >3s load time
- Every Kilobyte, Every Millisecond Matters - Mobile constraints are real
- Offline-First by Default - Network is unreliable, design for it
- User Context > Developer Environment - Think real-world usage scenarios
- Platform Awareness Without Platform Lock-In - Respect platform conventions
- Iterate, Don't Perfect - Ship, measure, improve cycle is survival
- Security and Accessibility by Design - Not afterthoughts
- Test on Real Devices - Simulators lie about performance
- Architecture Scales with Complexity - Don't over-engineer simple apps
- Continuous Learning is Survival - Mobile landscape evolves rapidly
See: references/mobile-mindset.md for thinking patterns and decision frameworks
Reference Navigation
Core Technologies:
mobile-frameworks.md- React Native, Flutter, Swift, Kotlin, framework comparison matrices, when to use eachmobile-ios.md- Swift 6, SwiftUI, iOS architecture patterns, HIG, App Store requirements, platform capabilitiesmobile-android.md- Kotlin, Jetpack Compose, Material Design 3, Play Store, Android-specific features
Best Practices & Development Mindset:
mobile-best-practices.md- Mobile-first design, performance optimization, offline-first architecture, security, testing, accessibility, deployment, analyticsmobile-debugging.md- Debugging tools, performance profiling, crash analysis, network debugging, platform-specific debuggingmobile-mindset.md- Thinking patterns, decision frameworks, platform-specific thinking, common pitfalls, debugging strategies
Key Best Practices (2024-2025)
Performance Targets:
- App launch: <2 seconds (70% abandon if >3s)
- Memory usage: <100MB for typical screens
- Network requests: Batch and cache aggressively
- Battery impact: Respect Doze Mode and background restrictions
- Animation: 60 FPS (16.67ms per frame)
Architecture:
- MVVM for small-medium apps (clean separation, testable)
- MVVM + Clean Architecture for large enterprise apps
- Offline-first with hybrid sync (push + pull)
- State management: Zustand (React Native), Riverpod 3 (Flutter), StateFlow (Android)
Security (OWASP Mobile Top 10):
- OAuth 2.0 + JWT + Biometrics for authentication
- Keychain (iOS) / KeyStore (Android) for sensitive data
- Certificate pinning for network security
- Never hardcode credentials or API keys
- Implement proper session management
Testing Strategy:
- Unit tests: 70%+ coverage for business logic
- Integration tests: Critical user flows
- E2E tests: Detox (React Native), Appium (cross-platform), XCUITest (iOS), Espresso (Android)
- Real device testing mandatory before release
Deployment:
- Fastlane for automation across platforms
- Staged rollouts: Internal → Closed → Open → Production
- Mandatory: iOS 17 SDK (2024), Android 15 API 35 (Aug 2025)
- CI/CD saves 20% development time
Quick Decision Matrix
| Need | Choose |
|---|---|
| JavaScript team, web code sharing | React Native |
| Performance-critical, complex animations | Flutter |
| Maximum iOS performance, latest features | Swift/SwiftUI native |
| Maximum Android performance, Material 3 | Kotlin/Compose native |
| Rapid prototyping | React Native + Expo |
| Desktop + mobile | Flutter |
| Enterprise with JavaScript skills | React Native |
| Startup with limited resources | Flutter or React Native |
| Gaming or heavy graphics | Native (Swift/Kotlin) or Unity |
Framework Quick Comparison (2024-2025)
| Criterion | React Native | Flutter | Swift/SwiftUI | Kotlin/Compose |
|---|---|---|---|---|
| Stars | 121K | 170K | N/A | N/A |
| Adoption | 35% | 46% | iOS only | Android only |
| Performance | 80-90% native | 85-95% native | 100% native | 100% native |
| Dev Speed | Fast (hot reload) | Very fast (hot reload) | Fast (Xcode Previews) | Fast (Live Edit) |
| Learning Curve | Easy (JavaScript) | Medium (Dart) | Medium (Swift) | Medium (Kotlin) |
| UI Paradigm | Component-based | Widget-based | Declarative | Declarative |
| Community | Huge (npm) | Growing | Apple ecosystem | Android ecosystem |
| Best For | JS teams, web sharing | Performance, animations | iOS-only apps | Android-only apps |
Implementation Checklist
Project Setup:
- Choose framework → Initialize project → Configure dev environment → Setup version control → Configure CI/CD → Team standards
Architecture:
- Choose pattern (MVVM/Clean) → Setup folders → State management → Navigation → API layer → Error handling → Logging
Core Features:
- Authentication → Data persistence → API integration → Offline sync → Push notifications → Deep linking → Analytics
UI/UX:
- Design system → Platform guidelines → Accessibility → Responsive layouts → Dark mode → Localization → Animations
Performance:
- Image optimization → Lazy loading → Memory profiling → Network optimization → Battery testing → Launch time optimization
Quality:
- Unit tests (70%+) → Integration tests → E2E tests → Accessibility testing → Performance testing → Security audit
Security:
- Secure storage → Authentication flow → Network security → Input validation → Session management → Encryption
Deployment:
- App icons/splash → Screenshots → Store listings → Privacy policy → TestFlight/Internal testing → Staged rollout → Monitoring
Platform-Specific Guidelines
iOS (Human Interface Guidelines):
- Native navigation patterns (tab bar, navigation bar)
- iOS design patterns (pull to refresh, swipe actions)
- San Francisco font, iOS color system
- Haptic feedback, 3D Touch/Haptic Touch
- Respect safe areas and notch
Android (Material Design 3):
- Material navigation (bottom nav, navigation drawer)
- Floating action buttons, material components
- Roboto font, Material You dynamic colors
- Touch feedback (ripple effects)
- Respect system bars and gestures
Common Pitfalls to Avoid
- Testing only on simulators - Real devices show true performance
- Ignoring platform conventions - Users expect platform-specific patterns
- No offline handling - Network failures will happen
- Poor memory management - Leads to crashes and poor UX
- Hardcoded credentials - Security vulnerability
- No accessibility - Excludes 15%+ of users
- Premature optimization - Optimize based on metrics, not assumptions
- Over-engineering - Start simple, scale as needed
- Skipping real device testing - Simulators don't show battery/network issues
- Not respecting battery - Background processing must be justified
Performance Budgets
Recommended Targets:
- App size: <50MB initial download, <200MB total
- Launch time: <2 seconds to interactive
- Screen load: <1 second for cached data
- Network request: <3 seconds for API calls
- Memory: <100MB for typical screens, <200MB peak
- Battery: <5% drain per hour of active use
- Frame rate: 60 FPS (16.67ms per frame)
Resources
Official Documentation:
- React Native: https://reactnative.dev/
- Flutter: https://flutter.dev/
- iOS HIG: https://developer.apple.com/design/human-interface-guidelines/
- Material Design: https://m3.material.io/
- OWASP Mobile: https://owasp.org/www-project-mobile-top-10/
Tools & Testing:
- Detox E2E: https://wix.github.io/Detox/
- Appium: https://appium.io/
- Fastlane: https://fastlane.tools/
- Firebase: https://firebase.google.com/
Community:
- React Native Directory: https://reactnative.directory/
- Pub.dev (Flutter packages): https://pub.dev/
- Awesome React Native: https://github.com/jondot/awesome-react-native
- Awesome Flutter: https://github.com/Solido/awesome-flutter
04 同仓库更多 Skills
现代全栈 Web 应用开发
web-frameworks
使用 Next.js(App Router、Server Components、RSC、PPR、SSR、SSG、ISR)、Turborepo(monorepo 管理、任务流水线、远程缓存、并行执行)和 RemixIcon(3100+ 线性/填充风格 SVG 图标)构建现代全栈 Web 应用。在创建 React 应用、实现服务端渲染、搭建含多个包的 monorepo、优化构建性能与缓存策略、添加图标库、管理共享依赖,或使用 TypeScript 全栈项目时使用。
UI 界面样式设计
ui-styling
使用 shadcn/ui 组件(基于 Radix UI + Tailwind 构建)、Tailwind CSS 的 utility-first 样式以及基于 canvas 的视觉设计,创建美观且无障碍的用户界面。适用于构建用户界面、实现设计系统、创建响应式布局、添加无障碍组件(对话框、下拉菜单、表单、表格)、定制主题与配色、实现深色模式、生成视觉设计与海报,或在应用程序间建立一致的样式规范。
Three.js 三维开发
threejs
使用 Three.js 构建沉浸式 3D Web 体验——这是一个 WebGL/WebGPU 库,支持场景、相机、几何体、材质、灯光、动画、加载器、后处理、着色器(包括基于节点的 TSL)、计算、物理、VR/XR 和高级渲染。适用于创建 3D 可视化、游戏、交互式图形、数据可视化、产品配置器、建筑漫游或 WebGL/WebGPU 应用。涵盖 OrbitControls、GLTF/FBX 加载、PBR 材质、阴影贴图、后处理效果(bloom、SSAO、SSR)、自定义着色器、实例化、LOD、动画系统和 WebXR。
结构化分步思考
sequential-thinking
对需要多步分析、修订能力和假设验证的复杂任务,采用结构化、反思性的方法解决问题。适用于复杂问题分解、自适应规划、需要调整方向的分析、范围不明确的问题、多步骤解决方案以及假设驱动的工作。
技术方案研究规划
research
当需要研究、分析和规划可扩展、安全且易于维护的技术解决方案时使用。
技术方案规划
planning
当你需要规划可扩展、安全且易于维护的技术方案时使用。