@@ -339,9 +339,34 @@ results. The Docker image is set up to launch `remote-test-server` and the
339339build tools use ` remote-test-client ` to communicate with the server to
340340coordinate running tests (see [ src/bootstrap/src/core/build_steps/test.rs] ).
341341
342- > ** TODO**
343- >
344- > - Is there any support for using an iOS emulator?
342+ To run on the iOS/tvOS/watchOS/visionOS simulator, we can similarly treat it as
343+ a "remote" machine. A curious detail here is that the network is shared between
344+ the simulator instance and the host macOS, so we can use the local loopback
345+ address ` 127.0.0.1 ` . Something like the following should work:
346+
347+ ``` sh
348+ # Build the test server for the iOS simulator:
349+ ./x build src/tools/remote-test-server --target aarch64-apple-ios-sim
350+
351+ # If you already have a simulator instance open, copy the device UUID from:
352+ xcrun simctl list devices booted
353+ UDID=01234567-89AB-CDEF-0123-456789ABCDEF
354+
355+ # Alternatively, create and boot a new simulator instance:
356+ xcrun simctl list runtimes
357+ xcrun simctl list devicetypes
358+ UDID=$( xcrun simctl create $CHOSEN_DEVICE_TYPE $CHOSEN_RUNTIME )
359+ xcrun simctl boot $UDID
360+ # See https://nshipster.com/simctl/ for details.
361+
362+ # Spawn the runner on port 12345:
363+ xcrun simctl spawn $UDID ./build/host/stage2-tools/aarch64-apple-ios-sim/release/remote-test-server -v --bind 127.0.0.1:12345
364+
365+ # In a new terminal, run tests via the runner:
366+ export TEST_DEVICE_ADDR=" 127.0.0.1:12345"
367+ ./x test --host=' ' --target aarch64-apple-ios-sim --skip tests/debuginfo
368+ # FIXME(madsmtm): Allow debuginfo tests to work (maybe needs `.dSYM` folder to be copied to the target?).
369+ ```
345370
346371[ armhf-gnu ] : https://github.com/rust-lang/rust/tree/master/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
347372[ QEMU ] : https://www.qemu.org/
0 commit comments