You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Github Actions自托管macOS构建iOS失败:设备受密码保护及后续问题

自托管GitHub Actions构建iOS应用时的两类构建失败问题

我在本地开发机上运行自托管GitHub Actions,目的是节省官方免费额度。大多数时候构建正常,但会遇到两类问题:


问题1:构建过程触发已锁定真实设备的连接错误

有时构建会卡在如下错误,错误提示指向已锁定的网络连接真实设备:

▸ Compiling CapacitorCamera_vers.c
▸ Compiling CapacitorCamera-dummy.m
▸ Compiling CameraPlugin.m
▸ Linking CapacitorCamera
2023-04-03 08:35:49.523 xcodebuild[36930:562246]  DTDKRemoteDeviceConnection: Failed to start remote service "com.apple.mobile.notification_proxy" on device. Error: Error Domain=com.apple.dtdevicekit Code=811 "Failed to start remote service "com.apple.mobile.notification_proxy" on device." UserInfo={NSUnderlyingError=0x6000037782d0 {Error Domain=com.apple.dt.MobileDeviceErrorDomain Code=-402653158 "The device is passcode protected." UserInfo={MobileDeviceErrorCode=(0xE800001A), com.apple.dtdevicekit.stacktrace=(
    0   DTDeviceKitBase                     0x00000001124acb1c DTDKCreateNSErrorFromAMDErrorCode + 300
    1   DTDeviceKitBase                     0x00000001124b90c4 __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 376
    2   DTDeviceKitBase                     0x00000001124b8944 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 28
    3   DTDeviceKitBase                     0x00000001124aec58 __DTDKExecuteInSession_block_invoke_2 + 48
    4   DTDeviceKitBase                     0x00000001124ae358 __DTDKExecuteWithConnection_block_invoke_2 + 216
    5   DTDeviceKitBase                     0x00000001124ae250 __DTDKExecuteWithConnection_block_invoke + 116
    6   libdispatch.dylib                   0x0000000190906504 _dispatch_client_callout + 20
    7   libdispatch.dylib                   0x0000000190915a9c _dispatch_lane_barrier_sync_invoke_and_complete + 56
    8   DVTFoundation                       0x0000000106753150 DVTDispatchBarrierSync + 148
    9   DVTFoundation                       0x000000010672e288 -[DVTDispatchLock performLockedBlock:] + 60
    10  DTDeviceKitBase                     0x00000001124ae148 DTDKExecuteWithConnection + 200
    11  DTDeviceKitBase                     0x00000001124aeb00 DTDKExecuteInSession + 228
    12  DTDeviceKitBase                     0x00000001124b87a0 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 128
    13  DVTFoundation                       0x0000000106752428 __DVT_CALLING_CLIENT_BLOCK__ + 16
    14  DVTFoundation                       0x0000000106752e94 __DVTDispatchAsync_block_invoke + 152
    15  libdispatch.dylib                   0x00000001909049dc _dispatch_call_block_and_release + 32
    16  libdispatch.dylib                   0x0000000190906504 _dispatch_client_callout + 20
    17  libdispatch.dylib                   0x000000019090dbbc _dispatch_lane_serial_drain + 672
    18  libdispatch.dylib                   0x000000019090e73c _dispatch_lane_invoke + 436
    19  libdispatch.dylib                   0x000000019091934c _dispatch_workloop_worker_thread + 652
    20  libsystem_pthread.dylib             0x0000000190a8a100 _pthread_wqthread + 288
    21  libsystem_pthread.dylib             0x0000000190a88e20 start_wqthread + 8
), DVTRadarComponentKey=261622, NSLocalizedDescription=The device is passcode protected.}}, NSLocalizedRecoverySuggestion=Please check your connection to your device., DVTRadarComponentKey=261622, NSLocalizedDescription=Failed to start remote service "com.apple.mobile.notification_proxy" on device.}
▸ Compiling ByteowlsCapacitorOauth2_vers.c
▸ Compiling ByteowlsCapacitorOauth2.m
▸ Compiling ByteowlsCapacitorOauth2-dummy.m
▸ Linking ByteowlsCapacitorOauth2
▸ Generating 'CapacitorCamera.framework.dSYM'
▸ Generating 'ByteowlsCapacitorOauth2.framework.dSYM'
▸ Touching CapacitorCamera.framework (in target 'CapacitorCamera' from project 'Pods')

我用Fastlane自动化构建流程,曾尝试构建时打开模拟器,但没有效果。我注意到Xcode中该真实设备处于锁定状态,不清楚xcodebuild为何会在构建过程中尝试连接它。


问题2:解除设备配对后仍出现Archive失败

将设备解除配对排除影响后,构建依然失败,错误信息指向Pod框架嵌入脚本执行失败,且同一机器上直接用Xcode构建完全正常:

Compiling Main.storyboard
▸ Compiling LaunchScreen.storyboard
▸ Compiling App_vers.c
▸ Linking App
▸ Processing Info.plist
▸ Running script '[CP] Embed Pods Frameworks'
▸ Generating 'App.app.dSYM'
    Run script build phase '[CP] Copy XCFrameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'FBSDKCoreKit_Basics' from project 'Pods')
    Run script build phase '[CP] Copy XCFrameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'FBAEMKit' from project 'Pods')
    Run script build phase '[CP] Copy XCFrameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'FBSDKCoreKit' from project 'Pods')
    Run script build phase '[CP] Copy XCFrameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'FBSDKLoginKit' from project 'Pods')
** ARCHIVE FAILED **


The following build commands failed:
    PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/alex/Library/Developer/Xcode/DerivedData/App-fclsinyvecksxwgujqmhxodzehpd/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/App.build/Release\ Dev-iphoneos/App.build/Script-9592DBEFFC6D2A0C8D5DEB22.sh (in target 'App' from project 'App')
(1 failure)
[09:57:45]: Exit status: 65

[!] Error building the application - see the log above
npm ERR! Lifecycle script `native:deploy:ios:development` failed with error: 
npm ERR! Error: command failed 

内容的提问来源于stack exchange,提问作者Titan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 22:02:58