Unable to install "MyApp" 追記あり

Unable to install "MyApp" 追記あり

開発中のiOSアプリをXcodeから実機インストールしていたら
Unable to install "MyApp" というエラーが発生するようになった。
MyAppはアプリ名

エラーのDetailsを確認すると

This application’s application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.

私の環境では、このエラーは再現したりしなかったり。
Xcodeでキャッシュの削除(Product > Clean Build Folder | ⇧⌘Kまたは⇧⌥⌘K)で再現しなくなったりまた再現したり、XcodeやmacOSの再起動などしても変わらず。再現性がわかりませんでした。

思い返すとこの開発中のアプリはEnterpriseアカウントでアプリの配布をしているので、以前にEnterprise配布ビルドのアプリをインストールして以来ずっと上書きをしていたかもしれない。

検証用のiPhoneでインストール済みのアプリを削除してからインストールしなおすと再現しなくなりました。
良かったです。

Details

Unable to install "MyApp"
Domain: com.apple.dtdevicekit
Code: -402652994
--
App installation failed
Domain: com.apple.dtdevicekit
Code: -402652994
Failure Reason: This application’s application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.
User Info: {
    DVTRadarComponentKey = 487927;
    "com.apple.dtdevicekit.stacktrace" = (
	0   DTDeviceKitBase                     0x000000011f0836e7 DTDKCreateNSError + 109
	1   DTDeviceKitBase                     0x000000011f083de9 DTDK_AMDErrorToNSError + 792
	2   DTDeviceKitBase                     0x000000011f0c356a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
	3   DVTFoundation                       0x0000000105e2fc12 DVTInvokeWithStrongOwnership + 73
	4   DTDeviceKitBase                     0x000000011f0c3301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
	5   IDEiOSSupportCore                   0x000000011ef4ba25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
	6   DVTFoundation                       0x0000000105f60e7a __DVT_CALLING_CLIENT_BLOCK__ + 7
	7   DVTFoundation                       0x0000000105f62552 __DVTDispatchAsync_block_invoke + 809
	8   libdispatch.dylib                   0x00007fff675f1583 _dispatch_call_block_and_release + 12
	9   libdispatch.dylib                   0x00007fff675f250e _dispatch_client_callout + 8
	10  libdispatch.dylib                   0x00007fff675f7ace _dispatch_lane_serial_drain + 597
	11  libdispatch.dylib                   0x00007fff675f8452 _dispatch_lane_invoke + 363
	12  libdispatch.dylib                   0x00007fff67601a9e _dispatch_workloop_worker_thread + 598
	13  libsystem_pthread.dylib             0x00007fff6784c6fc _pthread_wqthread + 290
	14  libsystem_pthread.dylib             0x00007fff6784b827 start_wqthread + 15
);
}
--

おしまい

---- 追記
この少し前に購入した安いLightningケーブルが問題だったかもしれない。
購入した商品はこちらです。今回の問題が起きるのは必ずこちらのケーブルの1本だけなので、5本セットのうち1本が不良品ということかもしれないです。
インストールがうまくいくこともあるので本当にわからない、けどこの問題のケーブルは処分します。