'Unable to install iOS app on device. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402653179

I am trying to build an iOS app on a device. I am able to build the project fine, but running into an issue when trying to get the app on device. When attempting to run, I am getting a Unable to install app error message from Xcode and the app is not installed on device. The detailed error message is as shown below:

Details

Unable to install "wordgame"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653179
--
Could not write to the device.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653179
User Info: {
    DVTRadarComponentKey = 261622;
    MobileDeviceErrorCode = "(0xE8000005)";
    "com.apple.dtdevicekit.stacktrace" = (
    0   DTDeviceKitBase                     0x00000001220d793f DTDKCreateNSErrorFromAMDErrorCode + 220
    1   DTDeviceKitBase                     0x0000000122116124 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
    2   DVTFoundation                       0x0000000106269b43 DVTInvokeWithStrongOwnership + 71
    3   DTDeviceKitBase                     0x0000000122115e65 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1440
    4   IDEiOSSupportCore                   0x0000000121f86d28 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.292 + 3513
    5   DVTFoundation                       0x00000001063982aa __DVT_CALLING_CLIENT_BLOCK__ + 7
    6   DVTFoundation                       0x0000000106399ecc __DVTDispatchAsync_block_invoke + 1191
    7   libdispatch.dylib                   0x00007fff70daa6c4 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x00007fff70dab658 _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x00007fff70db0c44 _dispatch_lane_serial_drain + 597
    10  libdispatch.dylib                   0x00007fff70db15d6 _dispatch_lane_invoke + 363
    11  libdispatch.dylib                   0x00007fff70dbac09 _dispatch_workloop_worker_thread + 596
    12  libsystem_pthread.dylib             0x00007fff71005a3d _pthread_wqthread + 290
    13  libsystem_pthread.dylib             0x00007fff71004b77 start_wqthread + 15
);
}
--


System Information

macOS Version 10.15.7 (Build 19H2)
Xcode 12.0.1 (17220)

I am a registered Apple Developer on a paid developer program. I am using the up-to-date version of macOS and Xcode.

I have tried by deleting project derived data, restarting the device, Xcode as well as the Mac. I have created a vanilla project and tried to run it on device with success, but could not do the same with my working project.

What are the steps that I can try to resolve?



Solution 1:[1]

I also had this exact same issue and error code. I was trying to run a newer development version of my app on an older phone that had a much older version of the app.

I found if I deleted the old version of the app from the phone then Xcode could then install the new version when I plugged in.

In between these two events my distribution certificates etc were renewed, not 100% sure if that was related but it worked for me by removing all old versions of the app.

Solution 2:[2]

I had the same problem with different targets. One target had a PRODUCT_NAME=AppName and the other target Appname (notice the caps). Whenever I built Appname then AppName and then again Appname, it would show black screen and some error about scenedelegate file not found.

Renaming Appname to AppnameGibberish resolved this error.

Solution 3:[3]

I have exact the same issue, when I switch branch to a much older repo long time ago, if I happen to run pod install, it will run out dated pods into the repo. And if you switch back to the latest repo, even you have run the pod install, it will just use the same old pod sdk you were using in the older repo. The solution is looking into the error description, uninstall that pod sdk from pod, and then re install that pod. To me, it's mapbox sdk uninstall and re-install, and then I am able to run the app.

Solution 4:[4]

Deleting the app on device and then re-building fixed the problem for me.

Solution 5:[5]

I removed the app on my iPhone then I tried again. It's fixed my issue

Solution 6:[6]

I have recently faced this issue and fixed, I have followed below steps, in developer portal, from Certificates, Identifiers & Profiles, I have selected profile option development I have selected my iPhone for installation after that I have selected profile option distribution I have valid certificate. after that I have download distribution profile and imported in xcode. Now build is installed in my Device.

Solution 7:[7]

  1. Reboot your Mac
  2. Reboot your iDevice
  3. Start Xcode
  4. Connect iDevice by cable
  5. Open Devices & Simulators, wait for pairing
  6. Build & Run again

Solution 8:[8]

You need to include the file in the target membership. Somehow you remove your target membership from any extension or class. Try this.

enter image description here

Solution 9:[9]

For me, this issue popped up after switching branches. After trying suggestions here and elsewhere, running pod install fixed it for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris S
Solution 2 TheLegend27
Solution 3 MarkZ
Solution 4 kgaidis
Solution 5 Ramazan Sağır
Solution 6 Prince Kumar
Solution 7 Sound Blaster
Solution 8 Jamil Hasnine Tamim
Solution 9 Rob VS