xcode The operation couldn’t be completed. (LaunchServicesError error 0.) 模拟器错误解决

本文解决了iOS模拟器上重复安装同一应用时出现的错误问题。通过检查项目的本地化设置,确保CFBundleShortVersionString和CFBundleVersion字段正确配置,从而避免安装失败。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近工程遇到一次问题,第一次运行程序到模拟器正常,第二次再运行就报错,删掉模拟器上的程序就好了;查了半天终于找到了原因,写下来防止大家也浪费时间:

原来在于我的工程做了本地化:具体设计到三个地方都要有以下两个字段:

"CFBundleShortVersionString" = "2.1.1";
"CFBundleVersion" = "2.1.1";

一旦缺少就会出现我遇到的错误。

具体需要注意的三个地方:
这里写图片描述

哦了,问题解决!

附录:

具体错误形式:

less ~/Library/Logs/CoreSimulator/CoreSimulator.log
Nov  6 11:53:47 Yggdrasil.local com.apple.dt.Xcode[4389] <Error>: 
Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed.
 (LaunchServicesError error 0.)" UserInfo=0x7fa697742360 
{Error=PackagePatchFailed, ErrorDescription=Could not hardlink copy 
/Volumes/UsersData/Users/kender/Library/Developer/CoreSimulator/Devices/AAD57C40-E208-4964-B63A-46B968B3EB36/data/Containers/Bundle/Application/FEE2DEB4-AEE3-48B7-BE71-5B027259C6FD/Baby Feeding.app 
to /Volumes/UsersData/Users/kender/Library/Developer/CoreSimulator/Devices/AAD57C40-E208-4964-B63A-46B968B3EB36/data/Library/Caches/com.apple.mobile.installd.staging/temp.P8QJEE/extracted/Payload/Baby Feeding.app
 with manifest /Volumes/UsersData/Users/kender/Library/Developer/CoreSimulator/Devices/AAD57C40-E208-4964-B63A-46B968B3EB36/data/Library/Caches/com.apple.mobile.installd.staging/temp.P8QJEE/extracted/com.apple.deltainstallcommands.com.owlcoding.babyfeeding}

参考链接:
http://stackoverflow.com/questions/26777794/iphone-simulator-reporting-error-when-re-installing-an-app-from-xcode

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值