PC パソコン

How to Fix “Logic Testing Unavailable: Logic Testing on iOS devices is not supported” in Xcode

If Xcode stops before running your unit tests with “Logic Testing Unavailable” and “Logic Testing on iOS devices is not supported,” Xcode is treating the test bundle as a hostless logic test while the selected destination is a physical iPhone or iPad. Run a true logic test on a Simulator, or configure an app host when the test genuinely needs an on-device application environment.

What the error means

Logic Testing Unavailable
Logic Testing on iOS devices is not supported.
You can run logic tests on the Simulator.

This is a launch-configuration failure, not a failed assertion. A hostless unit-test bundle and the selected physical-device destination do not form a supported test setup. Tests that require your iOS app process should use an application-hosted unit-test target.

When it applies

  • The scheme’s Test action targets a physical iPhone or iPad.
  • The unit-test target has no Host Application.
  • TEST_HOST or BUNDLE_LOADER is empty or contains a stale, manually entered path.
  • A copied or migrated target no longer matches the scheme and host app.
  • Only device testing fails after an Xcode update.

Recommended fix

1. Use a Simulator for a hostless logic test

Select an iOS Simulator in Xcode and choose Product > Test. For command-line testing, name an installed Simulator:

xcodebuild test   -scheme MyApp   -destination 'platform=iOS Simulator,name=iPhone 17'

This is the preferred setup for model, parsing, calculation, and other tests that do not depend on device-only behavior.

2. Configure a Host Application when device execution is required

  1. Select the unit-test target in the project editor.
  2. In the target’s General testing settings, choose the iOS app under Host Application. The exact location varies by Xcode version.
  3. Search Build Settings for TEST_HOST and BUNDLE_LOADER. Remove stale manual overrides and let Xcode derive them from the selected host app.
  4. Open Product > Scheme > Edit Scheme > Test and confirm that the intended test target is enabled.

Do not convert every framework or Swift Package logic test into an app-hosted test. If the test has no device dependency, keeping it hostless and running it on a Simulator produces a simpler and more portable setup.

3. Isolate a possible Xcode-version regression

Compare the same commit on a Simulator and a physical device, and with a previously working Xcode version if available. Device-test failures have been reported with Xcode 26.4, but Apple’s Xcode 26.4 release notes do not identify a universal fix for this exact message as of September 16, 2026. Verify the host and scheme configuration before classifying the result as an Xcode defect.

If the configuration is correct and only one Xcode release fails, temporarily pin CI to a verified Xcode release, retest with the latest stable release, and submit an issue through Feedback Assistant with the project diagnostics and result bundle.

Alternatives

  • Move platform-independent logic into a Swift Package and test it on a Simulator or macOS.
  • Hide device services behind protocols and inject test implementations into logic tests.
  • Keep device-only flows in app-hosted unit tests or UI tests.

How to verify the fix

  1. The test starts on the selected Simulator and appears in the Test navigator.
  2. For an app-hosted device test, the host app installs or launches and the logic-testing error no longer appears.
  3. xcodebuild test exits successfully and produces an .xcresult bundle.

Important notes

Deleting Derived Data can repair stale build products, but it cannot make an unsupported hostless-device configuration valid. Check the scheme and Host Application before changing signing or deployment settings.

Summary

The message means that Xcode is trying to launch a hostless logic test on a physical iOS device. Use a Simulator for pure logic tests, or select the correct Host Application for tests that need the app and device runtime. If the behavior appears version-specific, compare destinations and Xcode releases before applying a workaround.

References