如何使用 Visual Studio 从 Xamarin.Forms 项目生成 .apk 文件? [英] How to generate an .apk file from Xamarin.Forms Project using Visual Studio?

查看:53
本文介绍了如何使用 Visual Studio 从 Xamarin.Forms 项目生成 .apk 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Xamarin.Forms 项目,我想将它作为 apk 分发;但是我找不到如何在 Visual Studio 中生成 .apk 文件 - 我该怎么做?

I have a Xamarin.Forms project that I'd like to distribute as an apk; however I cannot find how to generate a .apk file in Visual Studio - how would I do this?

推荐答案

将 Visual Studio 2015 Update 3 与最新的 Xamarin 工具(编写此答案时为 v4.2.2.6)一起使用时,右键单击您的 Android 项目并选择存档..."如下所述:

When using Visual Studio 2015 Update 3 with the latest Xamarin tools (which is v4.2.2.6 when writing this answer), right click your Android project and select "Archive..." as described here:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_1_-_preparing_an_application_for_release/#Compile

这将打开归档管理器并开始归档应用程序包的过程.存档完成后,您可以单击存档管理器右下角的分发..."按钮来创建已签名的 APK.这在此处描述:

This will open the Archive Manager and begins the process of archiving the App bundle. When the archiving is finished, you can click on the button "Distribute..." at the right bottom corner of the Archive Manager to create a signed APK. This is described here:

https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/publishing_an_application/part_2_-_signing_the_android_application_package/

注意:如果您不使用已签名的 APK,则在尝试在 Android 设备上安装时可能会出现解析错误.

Note: if you do not use a signed APK, you will probably get a parse error if try to install on an Android device.

这篇关于如何使用 Visual Studio 从 Xamarin.Forms 项目生成 .apk 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆