如何使 Xamarin 应用程序的 Apk 在 Android 设备上运行 [英] How to make Apk of Xamarin Application to Run on Android Device

查看:39
本文介绍了如何使 Xamarin 应用程序的 Apk 在 Android 设备上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Xamarin 移动应用开发的新手.我开发了一个基本的移动应用,但在创建 .apk 以在我的三星 Galaxy S-5 Android 手机上测试它时遇到问题.我从谷歌搜索了几种方法,但都没有奏效.请为此提出一些简单的解决方案,如果有任何办法,我也想在 Windows 手机上运行该应用程序吗?.

如有任何帮助,我们将不胜感激.

解决方案

要生成 APK 文件,您需要在 Visual Studio 15 中执行以下步骤:

1.在您的工具栏中将项目从调试模式更改为发布模式

2.右键单击您的项目并选择存档...

3.单击生成的存档,在右侧下方,您将找到两个选项打开文件夹"和分发".(选择分发)

4.然后在出现的弹出窗口中选择 AD-HOC

5.点击绿色加号图标,在需要提供签字人或公司身份的地方添加签字身份

6.创建签名身份后,单击该身份以将其选中,然后单击另存为以保存您的 APK.

7. 将出现一个弹出窗口,询问您将在第 5 步中生成的签名身份的密码.

除非您使用 Xamarin 表单,否则同一个项目无法在 Windows Phone 上运行,因此我建议您在 Xamarin 表单中创建未来的项目,以便您可以访问 Xamarin 众所周知的跨平台功能.

祝你好运!

I am new to Xamarin Mobile App Development.I have developed a basic mobile app but I am having an issue with creating the .apk to test it on my Samsung Galaxy S-5 Android phone.I searched few ways from google but None of them worked. Kindly suggest some simple solution for this, also I want to run the app on windows phone too if there is any way for that as well?.

Any help would be grateful.

解决方案

For Generating an APK file you need to perform the following steps in Visual Studio 15:

1.In your toolbar change the project from debug mode to release mode

2.Right-click on your Project and Select Archive...

3.Click on the generated archive and below on the Right side you will find two options Open folder and Distribute. (Select Distribute)

4.Then on the Pop-up that appears Select AD-HOC

5.Click on the Green plus icon to add signing identity where you need to provide the identity of the signing person or company

6.After creating the signing identity click on that identity to select it and then click on save as to save your APK.

7.A pop-up will appear asking password for the signing identity which you will produce in step 5.

And The same project cannot run on windows phone unless you are using Xamarin forms, so I would suggest you that you create future projects in Xamarin forms so you can access the cross-platform feature that Xamarin is well known for.

Goodluck!

这篇关于如何使 Xamarin 应用程序的 Apk 在 Android 设备上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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