You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -250,7 +244,7 @@ With these scripts defined, you can:
250
244
251
245
```bash
252
246
# Build the APK
253
-
devbox run build
247
+
devbox run build:android
254
248
255
249
# Build, install, and launch on the emulator
256
250
devbox run start:app
@@ -259,7 +253,23 @@ devbox run start:app
259
253
devbox run start:app min
260
254
```
261
255
262
-
The `android.sh run` command waits for the emulator to boot, installs the APK, and launches the app. The app's package name is auto-detected from the APK.
256
+
**How APK auto-detection works:** The `android.sh run` command waits for the emulator to boot, then auto-detects the APK using this precedence chain:
257
+
258
+
1.`ANDROID_APP_APK` env var — if set, resolves the path/glob relative to project root
259
+
2. Recursive search of the project directory for `.apk` files, skipping `.gradle/`, `build/intermediates/`, `node_modules/`, and `.devbox/`
260
+
3. Recursive search of the current working directory (if different from project root)
261
+
262
+
The app's package name and launch activity are extracted from the APK automatically.
263
+
264
+
In most projects, step 2 finds the right APK with no configuration. If auto-detection picks the wrong APK (e.g., multiple build variants), set `ANDROID_APP_APK` explicitly:
Copy file name to clipboardExpand all lines: wiki/guides/ios-guide.md
+26-13Lines changed: 26 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,9 @@ The iOS plugin enables reproducible iOS development by automatically discovering
10
10
-**Automatic Xcode discovery**: Multi-strategy detection with caching for fast shell initialization
11
11
-**Device management**: JSON-based device definitions with CLI commands for creating, updating, and managing simulators
12
12
-**Simulator control**: Scripts for starting and stopping simulators
13
+
-**App deployment**: `ios.sh run` auto-detects your `.app` bundle, extracts the bundle ID, and deploys to the simulator
13
14
14
-
The plugin does **not** provide build or deploy commands. Every project has different Xcode configurations (project vs. workspace, different schemes, different derived data paths), so you define those in your own `devbox.json`. See [Adding Build Scripts](#adding-build-and-deploy-scripts) for patterns.
15
+
The plugin auto-detects your Xcode project, `.app` path, and bundle ID at runtime. You define a `build:ios` script in your `devbox.json` to handle the actual Xcode build, then `ios.sh run` handles everything else. See [Adding Build Scripts](#adding-build-and-deploy-scripts) for patterns.
15
16
16
17
Pure shells with `devbox run --pure` create test-specific simulators and clean up after execution, ensuring isolated, reproducible testing.
17
18
@@ -34,7 +35,7 @@ Create or modify your `devbox.json` to include the iOS plugin:
34
35
}
35
36
```
36
37
37
-
The Xcode project, build scheme, bundle ID, and app path are all auto-detected at runtime. Use `-derivedDataPath DerivedData` in your xcodebuild command to keep build output project-local.
38
+
Use `-derivedDataPath DerivedData` in your xcodebuild command to keep build output project-local.
38
39
39
40
### Initial Setup
40
41
@@ -250,9 +251,26 @@ The plugin provides simulator and device management. Build and deploy commands a
250
251
}
251
252
```
252
253
253
-
The `ios.sh run` command starts the simulator, builds (via`build:ios`), auto-detects the .app bundle, extracts the bundle ID, installs, and launches. The `${1:-}` syntax passes an optional device nickname through.
254
+
The `ios.sh run` command handles the full deployment pipeline: starts the simulator, runs your`build:ios` script, auto-detects the `.app` bundle, extracts the bundle ID from `Info.plist`, installs, and launches. The `${1:-}` syntax passes an optional device nickname through.
254
255
255
-
With these scripts defined, you can:
256
+
**How app auto-detection works:** After building, `ios.sh run` finds your `.app` bundle using this precedence chain:
257
+
258
+
1.`IOS_APP_ARTIFACT` env var — if set, resolves the path/glob relative to project root
259
+
2.`xcodebuild -showBuildSettings` — queries your Xcode project for BUILT_PRODUCTS_DIR + FULL_PRODUCT_NAME
260
+
3. Recursive search of the project directory for `.app` bundles, skipping `Pods/`, `.build/`, `node_modules/`, `.devbox/`, and similar directories
261
+
4. Recursive search of the current working directory (if different from project root)
262
+
263
+
In most projects, step 2 or 3 finds the right `.app` automatically with no configuration needed. If auto-detection doesn't work (e.g., multiple `.app` bundles, non-standard project layout), set `IOS_APP_ARTIFACT` explicitly:
The `include` line adds the Android plugin from GitHub. Devbox downloads the Android SDK, emulator, and device management tools automatically. The `packages` section adds JDK and Gradle for building your app. Set `ANDROID_APP_APK` to the path where your build outputs the APK.
45
+
The `include` line adds the Android plugin from GitHub. Devbox downloads the Android SDK, emulator, and device management tools automatically. The `packages` section adds JDK and Gradle for building your app.
49
46
50
47
> **Note:** Plugins are included via URL in `devbox.json`, not with `devbox add`. You cannot use `devbox add plugin:android`.
51
48
@@ -97,12 +94,9 @@ The plugin provides emulator and device management. Build and deploy commands ar
# Build, install, and launch on the default device
125
119
devbox run start:app
@@ -128,7 +122,19 @@ devbox run start:app
128
122
devbox run start:app min
129
123
```
130
124
131
-
The `android.sh run` command waits for the emulator to boot, installs the APK, and launches the app. The app's package name is auto-detected from the APK.
125
+
The `android.sh run` command waits for the emulator to boot, then auto-detects, installs, and launches the APK. The app's package name is extracted from the APK automatically.
126
+
127
+
**How APK auto-detection works:** The `run` command searches your project for `.apk` files, skipping build caches like `.gradle/`, `build/intermediates/`, `node_modules/`, and `.devbox/`. If your build outputs the APK to a standard location (e.g., `app/build/outputs/apk/`), it will be found automatically.
128
+
129
+
If auto-detection picks the wrong APK or you want to be explicit, set `ANDROID_APP_APK` in your `devbox.json` env. This accepts a path or glob pattern relative to your project root:
@@ -165,7 +171,7 @@ Replace the contents of your `devbox.json` with:
165
171
}
166
172
```
167
173
168
-
The `include` line adds the iOS plugin from GitHub. The plugin discovers your Xcode installation and provides simulator management tools. The Xcode project, build scheme, bundle ID, and app path are all auto-detected at runtime.
174
+
The `include` line adds the iOS plugin from GitHub. The plugin discovers your Xcode installation, manages simulators, and auto-detects your Xcode project, `.app`bundle, and bundle ID when deploying.
169
175
170
176
> **Note:** Plugins are included via URL in `devbox.json`, not with `devbox add`.
171
177
@@ -226,8 +232,6 @@ The plugin provides simulator and device management. Build and deploy commands a
226
232
227
233
As with the Android example, `${1:-}` passes an optional device nickname through (e.g., `devbox run start:app min`). If omitted, the default device is used.
228
234
229
-
The `ios.sh run` command starts the simulator, builds (via `build:ios`), auto-detects the .app bundle (via xcodebuild settings or recursive search), extracts the bundle ID from `Info.plist`, installs, and launches.
230
-
231
235
Now you can build and deploy:
232
236
233
237
```sh
@@ -238,6 +242,23 @@ devbox run build:ios
238
242
devbox run start:app
239
243
```
240
244
245
+
**How app auto-detection works:** The `ios.sh run` command starts the simulator, runs your `build:ios` script, then auto-detects the `.app` bundle. It uses this precedence chain:
246
+
247
+
1. Query `xcodebuild -showBuildSettings` for the built products path (works when your project has an `.xcodeproj` or `.xcworkspace` in the project root)
248
+
2. Recursive search of the project directory for `.app` bundles, skipping `Pods/`, `.build/`, `node_modules/`, `.devbox/`, and similar directories
249
+
250
+
The bundle ID is extracted automatically from the `.app`'s `Info.plist`.
251
+
252
+
If auto-detection picks the wrong `.app` or your project structure is non-standard, set `IOS_APP_ARTIFACT` in your `devbox.json` env. This accepts a path or glob pattern relative to your project root:
The React Native plugin automatically includes both the Android and iOS plugins. The iOS app project, scheme, bundle ID, and artifact path are all auto-detected at runtime.
305
+
The React Native plugin automatically includes both the Android and iOS plugins. APK and `.app` paths are auto-detected at runtime.
288
306
289
307
> **Note:** Plugins are included via URL in `devbox.json`, not with `devbox add`.
290
308
@@ -309,9 +327,6 @@ The plugin provides emulator/simulator control, device management, and Metro bun
0 commit comments