gpt4 book ai didi

ios - Xamarin iOS MSBuild - 缺少 OutputPath?

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:55:43 27 4
gpt4 key购买 nike

我目前正在从命令行构建我的 Xamamin iOS 项目:

MSBuild "C:\code\MyProject.iOS.csproj" /t:Build /p:Configuration=Ad-Hoc;Platform=iPhone;ServerAddress=MACIP;ServerUser=MACUSER

失败并出现以下错误:

The OutputPath property is not set for project 'MyProject.iOS.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.

但是,我在检查 CSPROJ 时设置了一个 OutputPath。

enter image description here

我可以通过在命令行中强制使用“OutputPath”参数来解决这个问题:

OutputPath="C:\builds\xamarin\cellar-ios"

注意: OutputPath="C:\builds\xamarin\cellar-ios\" 不起作用并且构建失败(注意结束反斜杠)

然而,这会创建一个奇怪的文件夹结构,它会在其中附加文件名:

enter image description here

关于我在这里做错了什么的想法?我觉得设置非常接近!

编辑

使用以下参数我能够让它工作。请注意,我仍然必须手动包含 OutputPath,但这暂时可以解决问题。

/t:Build /p:Configuration=Ad-Hoc;Platform=iPhone;ServerAddress=SERVER_IP;ServerUser=USER;ServerPassword=PASS;OutputPath=bin\iPhone\Ad-Hoc\

最佳答案

对于您的 .csproj 的任何自定义 OutputPath,它应该由 .csproj 中的 xbuild/msbuild 获取或作为属性(property)。

要自定义 IPA 的输出路径,您可以做的一件事是使用自定义 MSBuild 目标将 IPA 复制到您选择的文件夹(如果需要,您可以使用移动任务):

即(在您的 .csproj 中):

<PropertyGroup>
<CreateIpaDependsOn>
$(CreateIpaDependsOn);
CopyIpa
</CreateIpaDependsOn>
</PropertyGroup>

<Target Name="CopyIpa"
Condition="'$(OutputType)' == 'Exe'
And '$(ComputedPlatform)' == 'iPhone'
And '$(BuildIpa)' == 'true'">
<Copy
SourceFiles="$(IpaPackagePath)"
DestinationFolder="$(OutputPath)"
/>
</Target>

然后将 DestinationFolder 设置为所需的输出文件夹。

这可以在我们的知识库文章中找到:https://kb.xamarin.com/customer/portal/articles/2061038-can-i-change-the-output-path-of-the-ipa-file-

关于ios - Xamarin iOS MSBuild - 缺少 OutputPath?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38621282/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com