|
1 | | -# Segment Templates (mobile) |
| 1 | +# Devbox Plugins for Mobile Development |
2 | 2 |
|
3 | | -Shared Devbox plugins and example projects for Android, iOS, and React Native. |
| 3 | +Reproducible, project-local development environments for Android, iOS, and React Native using [Devbox](https://www.jetify.com/devbox). |
4 | 4 |
|
5 | | -## Devbox plugins |
6 | | -- `devbox/plugins/android` — Android SDK + emulator management in a project-local virtenv. |
7 | | -- `devbox/plugins/ios` — iOS toolchain + simulator management for macOS. |
8 | | -- `devbox/plugins/react-native` — Composition of Android + iOS plugins. |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +```bash |
| 8 | +# Add Android plugin to your project |
| 9 | +echo '{ |
| 10 | + "include": ["github:segment-integrations/devbox-plugins?dir=plugins/android"] |
| 11 | +}' > devbox.json |
| 12 | + |
| 13 | +# Enter development environment |
| 14 | +devbox shell |
| 15 | + |
| 16 | +# Start emulator and run app |
| 17 | +devbox run start-emu |
| 18 | +devbox run start-app |
| 19 | +``` |
| 20 | + |
| 21 | +**New to devbox-plugins?** Check out the [Quick Start Guide](wiki/guides/quick-start.md) for detailed setup instructions. |
| 22 | + |
| 23 | +## Features |
| 24 | + |
| 25 | +- **Project-Local State** - All emulators, simulators, and caches stay in your project directory |
| 26 | +- **Reproducible Environments** - Lock files ensure consistent SDK versions across machines |
| 27 | +- **No Global Pollution** - Won't touch `~/.android`, `~/Library/Developer`, or other global state |
| 28 | +- **Parallel Execution** - Run multiple test suites simultaneously with `--pure` isolation |
| 29 | +- **Device-Driven Configuration** - Define devices as JSON, sync AVDs/simulators declaratively |
| 30 | +- **CI/CD Optimized** - Device filtering and platform skipping for fast CI builds |
| 31 | + |
| 32 | +## Plugins |
| 33 | + |
| 34 | +### Android Plugin |
| 35 | + |
| 36 | +Nix-managed Android SDK with AVD management. |
| 37 | + |
| 38 | +```json |
| 39 | +{ |
| 40 | + "include": ["github:segment-integrations/devbox-plugins?dir=plugins/android"] |
| 41 | +} |
| 42 | +``` |
| 43 | + |
| 44 | +**Guides:** [Android Guide](wiki/guides/android-guide.md) | [Cheatsheet](wiki/guides/cheatsheets/android.md) |
| 45 | +**Reference:** [Android API](wiki/reference/android.md) |
| 46 | + |
| 47 | +### iOS Plugin |
| 48 | + |
| 49 | +Xcode toolchain integration with iOS Simulator management (macOS only). |
| 50 | + |
| 51 | +```json |
| 52 | +{ |
| 53 | + "include": ["github:segment-integrations/devbox-plugins?dir=plugins/ios"] |
| 54 | +} |
| 55 | +``` |
| 56 | + |
| 57 | +**Guides:** [iOS Guide](wiki/guides/ios-guide.md) | [Cheatsheet](wiki/guides/cheatsheets/ios.md) |
| 58 | +**Reference:** [iOS API](wiki/reference/ios.md) |
| 59 | + |
| 60 | +### React Native Plugin |
| 61 | + |
| 62 | +Composition layer over Android and iOS with Metro bundler management. |
| 63 | + |
| 64 | +```json |
| 65 | +{ |
| 66 | + "include": ["github:segment-integrations/devbox-plugins?dir=plugins/react-native"] |
| 67 | +} |
| 68 | +``` |
| 69 | + |
| 70 | +**Guides:** [React Native Guide](wiki/guides/react-native-guide.md) | [Cheatsheet](wiki/guides/cheatsheets/react-native.md) |
| 71 | +**Reference:** [React Native API](wiki/reference/react-native.md) |
| 72 | + |
| 73 | +## Documentation |
| 74 | + |
| 75 | +### For Users |
| 76 | + |
| 77 | +- **[Quick Start](wiki/guides/quick-start.md)** - Get started in 5 minutes |
| 78 | +- **[Device Management](wiki/guides/device-management.md)** - Managing emulators and simulators |
| 79 | +- **[Testing Guide](wiki/guides/testing.md)** - Testing strategies and best practices |
| 80 | +- **[Troubleshooting](wiki/guides/troubleshooting.md)** - Common issues and solutions |
| 81 | +- **[Cheatsheets](wiki/guides/cheatsheets/)** - One-page quick references |
| 82 | + |
| 83 | +### For Contributors |
| 84 | + |
| 85 | +- **[Contributing Guide](wiki/project/CONTRIBUTING.md)** - How to contribute |
| 86 | +- **[Architecture](wiki/project/ARCHITECTURE.md)** - Project structure and design |
| 87 | +- **[Testing](wiki/project/TESTING.md)** - Testing infrastructure |
| 88 | +- **[CI/CD](wiki/project/CI-CD.md)** - Continuous integration |
| 89 | + |
| 90 | +**Full documentation:** [Wiki Home](wiki/README.md) |
9 | 91 |
|
10 | 92 | ## Examples |
11 | | -- `devbox/examples/android` — Minimal Android app wired to the Android plugin. |
12 | | -- `devbox/examples/ios` — Swift package initialized via the iOS plugin. |
13 | | -- `devbox/examples/react-native` — React Native app wired to Android + iOS plugins. |
14 | | - |
15 | | -## Android plugin highlights |
16 | | -- Device definitions live in `devbox.d/android/devices/*.json`. |
17 | | -- Use `devbox run --pure android.sh devices list|create|update|delete` to manage devices. |
18 | | -- Set `EVALUATE_DEVICES` environment variable in `plugin.json` to limit which device APIs are evaluated by the flake (empty means all). |
19 | | -- `devbox run --pure start-emu [device]` boots an emulator. |
20 | | -- `devbox run --pure start-app [device]` builds/installs/launches on the resolved emulator. |
21 | | -See `devbox/plugins/android/REFERENCE.md` for the full Android reference. |
22 | | - |
23 | | -## iOS plugin highlights |
24 | | -- Simulator definitions live in `devbox.d/ios/devices/*.json`. |
25 | | -- `devbox run --pure start-sim [device]` boots a simulator. |
26 | | -- `devbox run --pure stop-sim` stops it. |
27 | | -See `devbox/plugins/ios/REFERENCE.md` for the full iOS reference. |
28 | | - |
29 | | -## React Native plugin highlights |
30 | | -- Composes the Android + iOS plugins. |
31 | | -- Android: `devbox run --pure start-emu`, `devbox run --pure start-app`, `devbox run --pure stop-emu`. |
32 | | -- iOS: `devbox run --pure start-sim`, `devbox run --pure stop-sim`. |
33 | | -See `devbox/plugins/react-native/REFERENCE.md` for the full React Native reference. |
34 | | - |
35 | | -## CI/CD |
36 | | - |
37 | | -Comprehensive GitHub Actions workflows are configured for testing: |
38 | | - |
39 | | -### Fast PR Checks (`pr-checks.yml`) |
40 | | -Runs automatically on every PR with quick validation: |
41 | | -- Plugin validation and unit tests |
42 | | -- Quick smoke tests on default devices |
43 | | -- ~15-30 minutes total |
44 | | - |
45 | | -### Full E2E Tests (`e2e-full.yml`) |
46 | | -Manually triggered or scheduled weekly to test: |
47 | | -- **Android**: API 21 (min) to API 36 (max) |
48 | | -- **iOS**: iOS 15.4 (min) to iOS 26.2 (max) |
49 | | -- **React Native**: Full cross-platform testing |
50 | | -- Matrix execution for parallel testing |
51 | | -- ~45-60 minutes per platform |
52 | | - |
53 | | -See [.github/workflows/README.md](.github/workflows/README.md) for detailed documentation. |
| 93 | + |
| 94 | +The repository includes example projects demonstrating plugin usage: |
| 95 | + |
| 96 | +- **[examples/android](examples/android/)** - Minimal Android app |
| 97 | +- **[examples/ios](examples/ios/)** - Swift package example |
| 98 | +- **[examples/react-native](examples/react-native/)** - React Native app with Android, iOS, and Web |
| 99 | + |
| 100 | +Each example includes device definitions, test suites, and build scripts. |
| 101 | + |
| 102 | +## Common Commands |
| 103 | + |
| 104 | +```bash |
| 105 | +# Android |
| 106 | +devbox run start-emu # Start Android emulator |
| 107 | +devbox run start-app # Build and launch app |
| 108 | +devbox run stop-emu # Stop emulator |
| 109 | + |
| 110 | +# iOS |
| 111 | +devbox run start-sim # Start iOS simulator |
| 112 | +devbox run start-ios # Build and launch app |
| 113 | +devbox run stop-sim # Stop simulator |
| 114 | + |
| 115 | +# Device management |
| 116 | +devbox run android.sh devices list |
| 117 | +devbox run ios.sh devices list |
| 118 | + |
| 119 | +# Testing |
| 120 | +devbox run test:fast # Quick tests (~2-5 min) |
| 121 | +devbox run test:e2e # Full E2E tests (~15-30 min) |
| 122 | +``` |
| 123 | + |
| 124 | +## Requirements |
| 125 | + |
| 126 | +- **[Devbox](https://www.jetify.com/devbox)** - Install with `curl -fsSL https://get.jetify.com/devbox | bash` |
| 127 | +- **macOS** - Required for iOS plugin (Xcode required) |
| 128 | +- **Linux** - Supported for Android and React Native (Android only) |
| 129 | + |
| 130 | +## License |
| 131 | + |
| 132 | +MIT |
| 133 | + |
| 134 | +## Support |
| 135 | + |
| 136 | +- **Questions?** Check [Troubleshooting](wiki/guides/troubleshooting.md) |
| 137 | +- **Found a bug?** [Open an issue](https://github.com/segment-integrations/devbox-plugins/issues) |
| 138 | +- **Want to contribute?** Read the [Contributing Guide](wiki/project/CONTRIBUTING.md) |
0 commit comments