微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – 如何在Visual Studio中创建Apk文件以开发Xamarin UI测试?

我正在尝试使用这个开发Xamarin.UiTests: “Introduction to Xamarin UITests,它说我的设置代码需要如下所示:

[SetUp]
public void Setup()
{
    app = ConfigureApp.Android.AppBundle("/path/to/application.apk").StartApp();
}

以前我习惯用右键单击我的项目并按“发布.apk文件”,这将创建一个文件供我使用.这里讨论了类似的技术:http://www.sweet-web-design.com/wordpress/how-to-build-your-android-app-for-testing-in-visual-studio/2581/

但是现在Xamarin引入了一个名为“Archiving”的东西,这里有人谈到:https://developer.xamarin.com/releases/vs/xamarin.vs_4/xamarin.vs_4.2/#publishing

哪个州:

The new Archive command replaces the old Build > Export Android
Package (.apk) and Tools > Android > Publish Android App commands.

归档按钮给我一个错误,我实际上无法读取(无论我有多大的窗口),请参阅下面的内容

enter image description here

那么我有没有办法使用visual studio创建一个.apk文件,最好没有“Archive”功能(因为在开发ui测试时创建一个单独的包版本似乎是浪费时间,加上实际上并不起作用)

解决方法

如果您是 associate the UITest project with your Android project,则在构建UITest项目时应自动生成.apk.

来自Xamarin文档:

The next step is to establish the association between the UITest project and the mobile apps. Right click on the References folder in the UITest project and select Add References… from the context menu. Select the mobile app projects from the Reference Manager dialog that appears.

完成此操作后,您无需在UITest中指定应用程序包的路径. .apk路径应该由Xamarin.UITest确定,因为引用了项目.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐