要为Xcode Cloud设置的Xcode Build版本标志

62lalag4  于 2023-04-22  发布在  其他
关注(0)|答案(1)|浏览(155)

我想在我的项目中设置一个标志,这样我就可以构建到设备上,并让XCode云正确管理构建号。
当前,当我使用${CI_BUILD_NUMBER}或${XCODE_CLOUD_BUILD_NUMBER}构建项目时
苹果在几个冗长的文档部分中没有提到你在Xcode构建字段中实际放置了什么,以使Xcode云以任何生产就绪的方式工作。
通过挖掘,我能够找到引用中的变量,XCODE_CLOUD_BUILD_NUMBER工作,但似乎完全没有文档记录:https://developer.apple.com/documentation/xcode/environment-variable-reference
当我使用这些标志和Xcode云构建我的项目时,构建工作如预期。当我在本地构建时,构建号从未设置,并导致在安装的最后一步中出现错误。
我得到下面显示的错误 *。

我的问题是:如何使用CI_BUILD_NUMBER或XCODE_CLOUD_BUILD_NUMBER标志,同时仍然保留本地安装能力(而无需每次更改标志)。
*

`Unable to install "<APPNAME>"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653028
User Info: {
    DVTErrorCreationDateKey = "2023-04-19 03:21:25 +0000";
    IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;
}
--
The bundle’s Info.plist does not contain a CFBundleVersion key or its value is not a string.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653028
User Info: {
    DVTRadarComponentKey = 261622;
    MobileDeviceErrorCode = "(0xE800009C)";
    "com.apple.dtdevicekit.stacktrace" = (
    0   DTDeviceKitBase                     0x000000010b890b1c DTDKCreateNSErrorFromAMDErrorCode + 300
    1   DTDeviceKitBase                     0x000000010b8c5000 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 136
    2   DVTFoundation                       0x0000000102083ac8 DVTInvokeWithStrongOwnership + 76
    3   DTDeviceKitBase                     0x000000010b8c4d7c -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1208
    4   IDEiOSSupportCore                   0x000000010ba47ce8 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.147 + 2340
    5   DVTFoundation                       0x000000010218e428 __DVT_CALLING_CLIENT_BLOCK__ + 16
    6   DVTFoundation                       0x000000010218ee94 __DVTDispatchAsync_block_invoke + 152
    7   libdispatch.dylib                   0x000000018f11d9dc _dispatch_call_block_and_release + 32
    8   libdispatch.dylib                   0x000000018f11f504 _dispatch_client_callout + 20
    9   libdispatch.dylib                   0x000000018f126bbc _dispatch_lane_serial_drain + 672
    10  libdispatch.dylib                   0x000000018f127708 _dispatch_lane_invoke + 384
    11  libdispatch.dylib                   0x000000018f13234c _dispatch_workloop_worker_thread + 652
    12  libsystem_pthread.dylib             0x000000018f2a2100 _pthread_wqthread + 288
    13  libsystem_pthread.dylib             0x000000018f2a0e20 start_wqthread + 8
);
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone9,1";
    "device_osBuild" = "15.7.3 (19H307)";
    "device_platform" = "com.apple.platform.iphoneos";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 3650;
    "operation_errorCode" = "-402653028";
    "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_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos16.4";
    "sdk_osVersion" = "16.4";
    "sdk_variant" = iphoneos;
}
--

System Information

macOS Version 13.0.1 (Build 22A400)
Xcode 14.3 (21812) (Build 14E222b)
Timestamp: 2023-04-18T20:21:25-07:00`

尝试将我的iOS项目中的内部版本号设置为以下内容:
1.${CI_BUILD_NUMBER}
1.${XCODE_CLOUD_BUILD_NUMBER}
1.${CI_BUILD_NUMBER:1}
1.${XCODE_CLOUD_BUILD_NUMBER:1}
我希望这个标志在本地构建时默认为一个值,或者如果Xcode云没有设置这个标志的话,默认为allow a fallback(示例3或4)。

kg7wmglp

kg7wmglp1#

看起来一个解决方案是添加不同的配置,然后为每个Xcode云配置使用自己的构建号(在- Cloud配置的情况下:${CI_BUILD_NUMBER})。
这些需要添加到每个配置的构建设置的版本控制部分中。

相关问题