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确定,因为引用了项目.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...