使用 msbuild 从命令行存档 Xamarin.Forms Android 项目

发布于 2025-01-14 20:35:36 字数 289 浏览 3 评论 0原文

对于 Xamarin.Forms iOS 项目,以下命令似乎有效:

msbuild /p:Configuration='Release' /p:Platform='iPhone' /p:IpaPackageDir=<DIRECTORY FOR IPA TO LIVE> /t:Build '../SampleApp.sln' /p:BuildIpa=true /p:ArchiveOnBuild=true

是否有像“ArchiveOnBuild”这样的参数用于归档 android 项目?

For Xamarin.Forms iOS project, the following command seems to work :

msbuild /p:Configuration='Release' /p:Platform='iPhone' /p:IpaPackageDir=<DIRECTORY FOR IPA TO LIVE> /t:Build '../SampleApp.sln' /p:BuildIpa=true /p:ArchiveOnBuild=true

Is there any such parameter like "ArchiveOnBuild" for archiving android projects?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

街角卖回忆 2025-01-21 20:35:36

如果您尚未在 csproj 文件中定义以下属性,则需要将它们作为 MSBuild 参数提供:

  • AndroidKeyStore = True
  • AndroidSigningKeyAlias = 您的密钥库别名
  • AndroidSigningKeyPass = 密钥库密码
  • AndroidSigningKeyStore = 密钥库路径
  • AndroidSigningStorePass = 密钥库密码

然后您可以运行使用目标

  • Build
  • SignAndroidPackage

进行构建,类似于:

/p:AndroidKeyStore=True /p:AndroidSigningKeyAlias=herpa /p:AndroidSigningKeyPass=hunter2 /p:AndroidSigningKeyStore=/my/path/to/app.keystore /p:AndroidSigningStorePass=hunter2 /t:Build;SignAndroidPackage

然后,在构建之后,APK 或 AAB 应该位于应用程序项目的 bin/Release 文件夹中。

If you haven't defined the following properties in your csproj file, then you would need to supply them as MSBuild arguments:

  • AndroidKeyStore = True
  • AndroidSigningKeyAlias = Your keystore alias
  • AndroidSigningKeyPass = keystore password
  • AndroidSigningKeyStore = path to keystore
  • AndroidSigningStorePass = keystore password

Then you can run your build with the targets

  • Build
  • SignAndroidPackage

So something like:

/p:AndroidKeyStore=True /p:AndroidSigningKeyAlias=herpa /p:AndroidSigningKeyPass=hunter2 /p:AndroidSigningKeyStore=/my/path/to/app.keystore /p:AndroidSigningStorePass=hunter2 /t:Build;SignAndroidPackage

Then after the build the APK or AAB should be in the bin/Release folder of your App project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文