mobile-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMobile 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
- 构建移动应用(iOS、Android或跨平台)
- 实现移动优先设计和UX模式
- 针对移动设备限制进行优化(电池、内存、网络、小屏幕)
- 在原生与跨平台技术间做选型决策
- 实现离线优先架构和数据同步
- 遵循平台特定指南(iOS HIG、Material Design)
- 优化移动应用性能和用户体验
- 实现移动安全与认证功能
- 测试移动应用(单元测试、集成测试、端到端测试)
- 部署至App Store和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: for detailed framework comparisons
references/mobile-frameworks.md跨平台框架:
- React Native:具备JavaScript技术栈、支持Web代码共享、生态成熟(121K星标,67%开发者熟悉)
- Flutter:适用于性能敏感型应用、复杂动画场景、增长速度最快(170K星标,46%采用率)
原生开发:
- iOS (Swift/SwiftUI):实现iOS平台极致性能、支持最新特性、深度整合Apple生态
- Android (Kotlin/Jetpack Compose):实现Android平台极致性能、支持Material Design 3、平台针对性优化
详情请见: 中的框架对比细节
references/mobile-frameworks.mdMobile 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: for thinking patterns and decision frameworks
references/mobile-mindset.md移动开发十诫:
- 性能是基础,而非特性 - 超过3秒加载时间的应用会被70%的用户放弃
- 每千字节、每毫秒都至关重要 - 移动设备的限制是真实存在的
- 默认采用离线优先设计 - 网络不可靠,需针对性设计
- 用户场景优先于开发环境 - 考虑真实世界的使用场景
- 了解平台特性但避免平台锁定 - 尊重平台惯例
- 快速迭代,而非追求完美 - 发布、衡量、优化的循环是生存之道
- 安全与无障碍设计从一开始就融入 - 而非事后补充
- 在真实设备上测试 - 模拟器无法反映真实性能
- 架构复杂度随项目规模扩展 - 不要对简单应用过度设计
- 持续学习是生存必需 - 移动领域发展迅速
详情请见: 中的思维模式和决策框架
references/mobile-mindset.mdReference Navigation
参考导航
Core Technologies:
- - React Native, Flutter, Swift, Kotlin, framework comparison matrices, when to use each
mobile-frameworks.md - - Swift 6, SwiftUI, iOS architecture patterns, HIG, App Store requirements, platform capabilities
mobile-ios.md - - Kotlin, Jetpack Compose, Material Design 3, Play Store, Android-specific features
mobile-android.md
Best Practices & Development Mindset:
- - Mobile-first design, performance optimization, offline-first architecture, security, testing, accessibility, deployment, analytics
mobile-best-practices.md - - Debugging tools, performance profiling, crash analysis, network debugging, platform-specific debugging
mobile-debugging.md - - Thinking patterns, decision frameworks, platform-specific thinking, common pitfalls, debugging strategies
mobile-mindset.md
核心技术:
- - React Native、Flutter、Swift、Kotlin、框架对比矩阵、各框架适用场景
mobile-frameworks.md - - Swift 6、SwiftUI、iOS架构模式、HIG、App Store要求、平台能力
mobile-ios.md - - Kotlin、Jetpack Compose、Material Design 3、Play Store、Android专属特性
mobile-android.md
最佳实践与开发思维:
- - 移动优先设计、性能优化、离线优先架构、安全、测试、无障碍设计、部署、数据分析
mobile-best-practices.md - - 调试工具、性能分析、崩溃排查、网络调试、平台专属调试方法
mobile-debugging.md - - 思维模式、决策框架、平台特定思维、常见陷阱、调试策略
mobile-mindset.md
Key Best Practices (2024-2025)
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
性能目标:
- 应用启动时间:<2秒(超过3秒会被70%用户放弃)
- 内存占用:典型页面<100MB
- 网络请求:批量处理并积极缓存
- 电池影响:遵循Doze模式和后台限制
- 动画:60 FPS(每帧16.67ms)
架构:
- 中小型应用采用MVVM(清晰解耦、可测试)
- 大型企业应用采用MVVM+Clean Architecture
- 离线优先设计搭配混合同步(推送+拉取)
- 状态管理:Zustand(React Native)、Riverpod 3(Flutter)、StateFlow(Android)
安全(OWASP移动Top 10):
- 采用OAuth 2.0 + JWT + 生物识别认证
- 使用Keychain(iOS)/KeyStore(Android)存储敏感数据
- 网络安全采用证书钉扎
- 绝不硬编码凭证或API密钥
- 实现完善的会话管理
测试策略:
- 单元测试:业务逻辑覆盖率≥70%
- 集成测试:覆盖关键用户流程
- 端到端测试:Detox(React Native)、Appium(跨平台)、XCUITest(iOS)、Espresso(Android)
- 发布前必须进行真实设备测试
部署:
- 使用Fastlane实现跨平台自动化
- 分阶段发布:内部测试→封闭测试→公开测试→正式生产
- 强制要求:iOS 17 SDK(2024)、Android 15 API 35(2025年8月)
- CI/CD可节省20%开发时间
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 |
| 需求 | 选择方案 |
|---|---|
| 拥有JavaScript团队、需要共享Web代码 | React Native |
| 性能敏感型应用、复杂动画 | Flutter |
| iOS平台极致性能、最新特性 | Swift/SwiftUI原生开发 |
| Android平台极致性能、Material 3 | Kotlin/Compose原生开发 |
| 快速原型开发 | React Native + Expo |
| 桌面+移动端跨平台 | Flutter |
| 具备JavaScript技术栈的企业 | React Native |
| 资源有限的初创公司 | Flutter或React Native |
| 游戏或重度图形应用 | 原生(Swift/Kotlin)或Unity |
Framework Quick Comparison (2024-2025)
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 |
| 评估维度 | React Native | Flutter | Swift/SwiftUI | Kotlin/Compose |
|---|---|---|---|---|
| 星标数量 | 121K | 170K | N/A | N/A |
| 采用率 | 35% | 46% | 仅iOS | 仅Android |
| 性能 | 80-90%原生水平 | 85-95%原生水平 | 100%原生水平 | 100%原生水平 |
| 开发速度 | 快(热重载) | 极快(热重载) | 快(Xcode预览) | 快(实时编辑) |
| 学习曲线 | 简单(JavaScript) | 中等(Dart) | 中等(Swift) | 中等(Kotlin) |
| UI范式 | 组件化 | 小部件化 | 声明式 | 声明式 |
| 社区生态 | 庞大(npm) | 快速增长 | Apple生态 | Android生态 |
| 最佳适用场景 | JS团队、Web代码共享 | 性能要求高、动画复杂 | 仅iOS应用 | 仅Android应用 |
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
项目搭建:
- 选择框架→初始化项目→配置开发环境→设置版本控制→配置CI/CD→制定团队规范
架构设计:
- 选择架构模式(MVVM/Clean)→设置目录结构→状态管理→导航→API层→错误处理→日志系统
核心功能:
- 认证→数据持久化→API集成→离线同步→推送通知→深度链接→数据分析
UI/UX:
- 设计系统→平台指南→无障碍设计→响应式布局→深色模式→多语言本地化→动画效果
性能优化:
- 图片优化→懒加载→内存分析→网络优化→电池测试→启动时间优化
质量保障:
- 单元测试(≥70%覆盖率)→集成测试→端到端测试→无障碍测试→性能测试→安全审计
安全防护:
- 安全存储→认证流程→网络安全→输入验证→会话管理→加密
部署上线:
- 应用图标/启动页→截图→商店列表→隐私政策→TestFlight/内部测试→分阶段发布→监控
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
iOS(Human Interface Guidelines):
- 原生导航模式(标签栏、导航栏)
- iOS设计模式(下拉刷新、滑动操作)
- San Francisco字体、iOS色彩系统
- 触觉反馈、3D Touch/Haptic Touch
- 尊重安全区域和刘海屏
Android(Material Design 3):
- Material导航(底部导航、导航抽屉)
- 浮动操作按钮、Material组件
- Roboto字体、Material You动态色彩
- 触摸反馈(涟漪效果)
- 尊重系统栏和手势操作
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
- 仅在模拟器上测试 - 真实设备才能反映真实性能
- 忽略平台惯例 - 用户期望符合平台特定的交互模式
- 未做离线处理 - 网络故障必然会发生
- 内存管理不当 - 导致崩溃和糟糕的用户体验
- 硬编码凭证 - 存在安全漏洞
- 未做无障碍设计 - 排除15%以上的用户群体
- 过早优化 - 基于数据指标而非假设进行优化
- 过度设计 - 从简单开始,随需求扩展
- 跳过真实设备测试 - 模拟器无法体现电池/网络问题
- 不考虑电池消耗 - 后台处理必须有合理理由
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)
推荐目标:
- 应用大小:初始下载包<50MB,总大小<200MB
- 启动时间:<2秒进入可交互状态
- 页面加载:缓存数据下<1秒
- 网络请求:API调用<3秒
- 内存占用:典型页面<100MB,峰值<200MB
- 电池消耗:活跃使用每小时耗电<5%
- 帧率:60 FPS(每帧16.67ms)
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
官方文档:
- 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/
工具与测试:
- Detox E2E: https://wix.github.io/Detox/
- Appium: https://appium.io/
- Fastlane: https://fastlane.tools/
- Firebase: https://firebase.google.com/
社区资源:
- 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