SwiftUI项目可构建但无法在iPhone 12 Pro Max运行(配置文件错误)
SwiftUI项目无法在iPhone 12 Pro Max真机运行
我的SwiftUI项目可正常构建,但无法在iPhone 12 Pro Max(设备型号iPhone13,4,系统版本iOS16.3.1)上运行,模拟器运行一切正常。已将设备添加至开发者账号,尝试过以下方案均无效:
- 重新安装证书
- 重新配置证书
- 删除派生数据并重建项目
- 移除设备后重新配置
错误信息
Details Unable to install "VRTwente" Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402620395 User Info: { DVTErrorCreationDateKey = "2023-02-24 09:26:52 +0000"; IDERunOperationFailingWorker = IDEInstalliPhoneLauncher; } -- A valid provisioning profile for this executable was not found. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402620395 User Info: { DVTRadarComponentKey = 487925; MobileDeviceErrorCode = "(0xE8008015)"; "com.apple.dtdevicekit.stacktrace" = ( 0 DTDeviceKitBase 0x00000001104382bc DTDKCreateNSErrorFromAMDErrorCode + 300 1 DTDeviceKitBase 0x000000011046c3c0 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 136 2 DVTFoundation 0x0000000105f1a0e0 DVTInvokeWithStrongOwnership + 76 3 DTDeviceKitBase 0x000000011046c144 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1196 4 IDEiOSSupportCore 0x0000000110147c34 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.147 + 2328 5 DVTFoundation 0x000000010602499c __DVT_CALLING_CLIENT_BLOCK__ + 16 6 DVTFoundation 0x0000000106025408 __DVTDispatchAsync_block_invoke + 152 7 libdispatch.dylib 0x00000001a44949dc _dispatch_call_block_and_release + 32 8 libdispatch.dylib 0x00000001a4496504 _dispatch_client_callout + 20 9 libdispatch.dylib 0x00000001a449dbbc _dispatch_lane_serial_drain + 672 10 libdispatch.dylib 0x00000001a449e708 _dispatch_lane_invoke + 384 11 libdispatch.dylib 0x00000001a44a934c _dispatch_workloop_worker_thread + 652 12 libsystem_pthread.dylib 0x00000001a4619100 _pthread_wqthread + 288 13 libsystem_pthread.dylib 0x00000001a4617e20 start_wqthread + 8 ); } -- Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : { "device_model" = "iPhone13,4"; "device_osBuild" = "16.3.1 (20D67)"; "device_platform" = "com.apple.platform.iphoneos"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 2390; "operation_errorCode" = "-402620395"; "operation_errorDomain" = "com.apple.dt.MobileDeviceErrorDomain"; "operation_errorWorker" = IDEInstalliPhoneLauncher; "operation_name" = IDEiPhoneRunOperationWorkerGroup; "param_consoleMode" = 0; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 5; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphoneos"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_runnable_type" = 2; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphoneos16.2"; "sdk_osVersion" = "16.2"; "sdk_variant" = iphoneos; } -- System Information macOS Version 13.1 (Build 22C65) Xcode 14.2 (21534) (Build 14C18) Timestamp: 2023-02-24T10:26:52+01:00
环境信息
- macOS:13.1 (22C65)
- Xcode:14.2 (14C18)
解决方案尝试
检查自动签名配置
打开项目Signing & Capabilities面板,确认Team选择对应开发者账号,勾选Automatically manage signing。若之前手动配置过,先取消再重新勾选,触发Xcode重新生成描述文件。验证设备UDID有效性
在Xcode的Window > Devices and Simulators中复制设备UDID,登录苹果开发者后台,确认该UDID已添加且状态正常。清理证书缓存
打开Keychain Access,删除所有苹果开发相关证书,重启Xcode后让其自动重新下载安装证书。匹配Xcode与iOS版本
当前Xcode14.2仅支持到iOS16.2,设备系统为iOS16.3.1,存在版本不兼容。可升级Xcode至14.3及以上,或降级设备系统到iOS16.2。重置Xcode偏好设置
关闭Xcode,执行终端命令defaults delete com.apple.dt.Xcode,重启Xcode后重新配置项目。信任开发者账号
在iPhone的设置 > 通用 > VPN与设备管理中,找到你的开发者账号并点击信任。
内容的提问来源于stack exchange,提问作者Julian van Heek
相关产品推荐
相关产品推荐

