PC パソコン

How to Fix Xcode “Failed to install the app on the device”

When you try to run an app on a physical iPhone or iPad from Xcode, you may encounter Failed to install the app on the device. This error occurs during the installation stage and can be caused by code signing, provisioning profiles, Bundle Identifier conflicts, an existing app on the device, insufficient storage, Developer Mode, or device connectivity. This guide explains how to identify the cause and fix the problem step by step.

What does “Failed to install the app on the device” mean?

The message indicates that Xcode built the application but could not complete installation on the selected physical device. Because it is a general installation-failure message, the surrounding detailed error and error code are usually more useful for identifying the root cause.

Example

Failed to install the app on the device

Check the messages immediately before and after this line for more specific information about signing, provisioning, the Bundle Identifier, or the device.

Common causes

  • Incorrect Signing & Capabilities configuration
  • A provisioning profile that does not match the app
  • A Bundle Identifier conflict
  • An existing copy of the app installed with different signing credentials
  • Insufficient storage on the iPhone or iPad
  • Developer Mode is disabled
  • A pairing or connection problem between the Mac and device
  • An incompatible Xcode and iOS combination
  • Entitlements that do not match the provisioning profile
  • Stale build data

1. Read the detailed error

Open Xcode’s Report navigator and inspect the failed Run operation. Do not rely only on the final “Failed to install the app on the device” message. A more specific error immediately before it may identify the actual installation problem.

This message does not represent one single root cause. Avoid randomly changing signing or Build Settings before checking the detailed error.

2. Remove the existing app from the device

If an app with the same Bundle Identifier is already installed but was signed with different credentials, iOS may reject the new build as an update.

  1. Delete the app from the iPhone or iPad.
  2. In Xcode, choose Product → Clean Build Folder.
  3. Select the physical device and run the app again.

This is especially worth checking after changing the development team or signing certificate.

3. Check Signing & Capabilities

Open Target → Signing & Capabilities and review the Team, Bundle Identifier, Signing Certificate, and provisioning settings. If you use automatic signing, make sure Automatically manage signing is configured as intended.

  • Confirm that the correct Team is selected.
  • Verify the Bundle Identifier.
  • Check for signing errors or warnings.
  • Make sure the physical device is eligible for the development provisioning configuration.

4. Check the Bundle Identifier

If an App Store build or an app signed by another development team is already installed, a development build using the same Bundle Identifier may not be accepted as an update. When appropriate, use a separate development Bundle Identifier.

com.example.app
com.example.app.dev

5. Check available device storage

Installation can fail when the device is low on storage. Open Settings → General → iPhone Storage and make sure there is sufficient free space before trying again.

6. Check Developer Mode

Physical-device development on supported iOS versions requires Developer Mode. Check the device settings and enable Developer Mode when required. Enabling it may require a restart and confirmation on the device.

7. Check the device connection

USB, wireless debugging, trust settings, or pairing problems can interrupt installation. Quit Xcode, disconnect the device, restart both the Mac and device, reconnect them, and try again. If the device asks whether to trust the computer, approve the request.

8. Check Xcode and iOS compatibility

If the device is running an iOS version that is newer than the installed Xcode version supports, installation or debugging can fail. Verify that your Xcode version supports the iOS version on the device and update Xcode when necessary.

9. Check entitlements

If the error appeared after adding capabilities such as Push Notifications, iCloud, or Associated Domains, verify that the app’s entitlements match the provisioning configuration. Also check Signing & Capabilities for capabilities that are no longer required.

10. Remove DerivedData

After correcting the underlying configuration, stale build data can occasionally continue to cause problems. Remove DerivedData and rebuild.

rm -rf ~/Library/Developer/Xcode/DerivedData/*

Restart Xcode, run Product → Clean Build Folder, and try the physical-device build again.

Removing DerivedData can resolve cache-related issues, but it does not fix an incorrect certificate, provisioning profile, or entitlement. Correct the configuration identified by the detailed error first.

Summary

Xcode’s “Failed to install the app on the device” message means the build could not be installed on the selected physical device. Start with the detailed error, then check the existing app, Signing & Capabilities, Bundle Identifier, available storage, Developer Mode, device connectivity, Xcode/iOS compatibility, and entitlements.

After fixing the underlying issue, use Clean Build Folder or remove DerivedData if needed, reconnect the device, and run the app again.