手机扫一扫访问本页内容

微信扫描点右上角"···"分享到好友或朋友圈

关闭
微信扫一扫可打开小程序

微信长按图片或搜“分享录”可打开小程序

关闭
iOS,经验 , ,

Xcode打包iOS项目报Unable to install xxx而无法安装app到iPhone

本文图文讲解用Xcode打包iOS项目时报Unable to install xxx而无法将app安装到iPhone。

app项目加新功能添加了一些依赖库后打包的时候报Unable to install xxx而无法将app安装到iPhone,具体信息如下图:

Details:

Details

Unable to install "fenxianglu"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
--
Could not inspect the application package.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103
User Info: {
    DVTRadarComponentKey = 282703;
    MobileDeviceErrorCode = "(0xE8000051)";
    "com.apple.dtdevicekit.stacktrace" = (
	0   DTDeviceKitBase                     0x000000012a67199f DTDKCreateNSErrorFromAMDErrorCode + 220
	1   DTDeviceKitBase                     0x000000012a6b0164 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
	2   DVTFoundation                       0x000000010d579993 DVTInvokeWithStrongOwnership + 71
	3   DTDeviceKitBase                     0x000000012a6afea5 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1440
	4   IDEiOSSupportCore                   0x000000012a5207bc __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.292 + 3513
	5   DVTFoundation                       0x000000010d6a82ae __DVT_CALLING_CLIENT_BLOCK__ + 7
	6   DVTFoundation                       0x000000010d6a9ed0 __DVTDispatchAsync_block_invoke + 1191
	7   libdispatch.dylib                   0x00007fff201745dd _dispatch_call_block_and_release + 12
	8   libdispatch.dylib                   0x00007fff201757c7 _dispatch_client_callout + 8
	9   libdispatch.dylib                   0x00007fff2017b5fe _dispatch_lane_serial_drain + 606
	10  libdispatch.dylib                   0x00007fff2017c0cb _dispatch_lane_invoke + 375
	11  libdispatch.dylib                   0x00007fff20185c5d _dispatch_workloop_worker_thread + 819
	12  libsystem_pthread.dylib             0x00007fff2031d499 _pthread_wqthread + 314
	13  libsystem_pthread.dylib             0x00007fff2031c467 start_wqthread + 15
);
}
--


System Information

macOS Version 11.0.1 (Build 20B29)
Xcode 12.2 (17535) (Build 12B45b)
Timestamp: 2020-12-06T16:59:42+08:00

网上有说添加的组件库中缺少plist文件、bundle ID重复的、证书问题、Xcode缓存问题等等,但排查后都没解决问题,包括删了Xcode缓存~/Library/Developer/Xcode/DerivedData目录下的文件后重新打包还是不行。

后面发现我在添加依赖库后把Embed改成了“Embed & Sign”或者“Embed Without Signing”:

实际上只需要把它改回“Do Not Embed”即可解决问题,如果非要Embed,那就在Build Phases -> Embedded Frameworks ->勾选 “Copy only when installing”:

另外遇到这种问题要根据具体的提示信息来排查问题,我这里是报“Could not inspect the application package.”,其他可能是“The maximum number of apps for free development profiles has been reached”或者“The certificate used to sign “XXX” has either expired or has been revoked. An updated certificate is required to sign and install the application.”等等,具体问题具体分析。


历史上的今天:

展开阅读全文


上一篇:

下一篇:

服务器又要到期了鼓励一下吧
您还可以访问本站的小程序、公众号等所有端,或者下载APP, 在小程序、APP上可以评论文章以及保存图片还有在线客服哦,如您有任何疑问或建议可向作者提出意见反馈
扫码打开小程序可评论文章保存图片,在“我的”有实时在线客服哦,看效果?
关注我的公众号为您分享各类有用信息
分享录多端跨平台系统