当连接真机运行,xcode出现unable to launch xxx,此时我们可以点击detail来查看详情。
image.png
Details
Unable to install "xxx"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620395
User Info: {
DVTErrorCreationDateKey = "2022-08-04 09:02:42 +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 0x00000002869debec DTDKCreateNSErrorFromAMDErrorCode + 272
1 DTDeviceKitBase 0x0000000286a1a3f4 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 160
2 DVTFoundation 0x00000001061af94c DVTInvokeWithStrongOwnership + 76
3 DTDeviceKitBase 0x0000000286a1a144 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1312
4 IDEiOSSupportCore 0x00000002868e3a60 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.292 + 2908
5 DVTFoundation 0x00000001062da66c __DVT_CALLING_CLIENT_BLOCK__ + 16
6 DVTFoundation 0x00000001062dbc58 __DVTDispatchAsync_block_invoke + 564
7 libdispatch.dylib 0x00000001b8ba0e60 _dispatch_call_block_and_release + 32
8 libdispatch.dylib 0x00000001b8ba2bac _dispatch_client_callout + 20
9 libdispatch.dylib 0x00000001b8baa330 _dispatch_lane_serial_drain + 672
10 libdispatch.dylib 0x00000001b8baaea4 _dispatch_lane_invoke + 392
11 libdispatch.dylib 0x00000001b8bb5708 _dispatch_workloop_worker_thread + 656
12 libsystem_pthread.dylib 0x00000001b8d5d5b0 _pthread_wqthread + 288
13 libsystem_pthread.dylib 0x00000001b8d5c2c4 start_wqthread + 8
);
}
--
Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "iPhone12,1";
"device_osBuild" = "15.1 (19B74)";
"device_platform" = "com.apple.platform.iphoneos";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 15070;
"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_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_swiftVersion" = "5.5.2";
"param_runnable_type" = 2;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphoneos15.2";
"sdk_osVersion" = "15.2";
"sdk_variant" = iphoneos;
}
--
System Information
macOS Version 12.0.1 (Build 21A559)
Xcode 13.2.1 (19586) (Build 13C100)
Timestamp: 2022-08-04T17:02:42+08:00
代码错误
错误代码 可能错误原因
402653103: 错把静态库加载成动态库
402653415: 免费app达到最大数目
402652994: 设备装有相同bundle id的应用
402653150: iOS设备要用xcode12来调试
402653170: 测试设备运行内存不足,退出部分或者所有后台应用试试
402620395: 用dis证书来dev调试
402620375 打包macOS版本低于11,需要更新macOS版本或者设置--generate-entitlement-der(调用codesign之前调用或者在xcode->OTHER_CODE_SIGN_FLAGS设置 --generate-entitlement-der)
The code signature version is no longer supported.
解决:
TARGETS -> General -> Frameworks,Libraries,and EmbeddedContent -> 将Embed and Sign 设置为 Do Not Embed。
image.png
问题:
Command PhaseScriptExecution failed with a nonzero exit code