Xamarin.iOS - MSBUILD不生成IPA文件。

4

我正在为iOS应用程序设置构建环境。我使用iMac作为构建主机,并使用Visual Studio 2013 community版。当我从Visual Studio构建解决方案时,一切正常,它会生成IPA。但是当我尝试使用msbuild构建项目时,项目可以成功构建,但它不会生成IPA文件。然而,它会给出以下警告:

(_SayHello target) -> C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets( 54,5): warning : Object reference not set to an instance of an object.

我使用的命令行是:msbuild "solution.sln" /t:build /p:Configuration=release

2个回答

2

我在这里找到了答案。

命令行中需要两个额外的属性:1)ServerAddress和2)ServerUsernameExample。

msbuild "solution.sln" /t:build /p:Configuration=release /p:ServerAddress=xx.xx.xx.xx:22 /p:ServerUser=userName

其中xx.xx.xx.xx是Mac构建主机的IP地址,"userName"是Mac构建主机上的有效用户名。


"/p:ServerAddress=macName /p:ServerUser=macUser" 对我很有效。我们的 Mac 是 Windows 域的成员。 - Aleksandr

0

我们一直在使用mdtool和vstool。此外还请参见这个问题。建议并支持使用msbuild命令。这个msbuild命令在Mac上本身就可以创建应用程序:

msbuild -target:Build "my.sln" -property:Configuration="Release" -property:Platform="iPhone" 

我们接着拿取创建好的应用程序文件。
 cd myapp/bin/iPhone/Release
 mkdir Payload
 cp -R my.app Payload

然后将有效载荷压缩为IPA文件

 /usr/bin/zip -ry my.ipa "Payload"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接