android - mdtool,在 mac 上构建 android apk

标签 android xamarin.android apk mdtool

我有一个 Xamarin 项目,希望使用 mdtool 和命令行构建一个 Android apk。 这是设置:

我有一台 mac mini - Xamarin Studio 安装在上面,我有构建没问题的解决方案。 现在从命令行这就是我想要做的

#REM Traverse to the folder which holds the .sln file
cd One/Xamarin/Android/OneAndroid 

#REM start the build using mdtool
'/Applications/Xamarin Studio.app/Contents/MacOS/mdtool' -v build OneAndroid.sln

上面为我完成了构建,但是我没有得到 apk 文件。 有人可以告诉我需要将哪个选项添加到 mdtool 上以生成 apk 文件吗?

谢谢 拉杰什

我知道我可能缺少 mdtool 的一些参数

最佳答案

使用XBuild编译APK,例如:

xbuild MyXamarinAndroidApplication.csproj /p:Configuration=Release /t:SignAndroidPackage

这将在 Release模式下编译项目并生成签名和未签名的 APK。如果您只想要一个未签名的 APK:

xbuild MyXamarinAndroidApplication.csproj /p:Configuration=Release /t:PackageForAndroid

值得注意的是,您必须指定 .csproj,而不是 .sln。如果你给它一个解决方案文件,你会得到一个错误,提示它找不到“SignAndroidPackage”目标。

关于android - mdtool,在 mac 上构建 android apk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21333844/

相关文章:

android - apk 必须使用与之前版本相同的证书进行签名

android - ImageView 显示奇怪的全彩框

Android Permission Denial 启动Intent for Wallpaper Settings

android - Python 和 openCV 到 android APK

android - "Visual Studio for Mac"代码完成在 Xamarin.Android 中勉强工作

c# - 从日期时间到当前时区的 Unix 纪元时间的转换

android - 汽车游戏的建筑玩家

android - 如何在 asynctask android 之后刷新 ListView

android - NVIDIA K1 Shield 平板电脑的 OpenCL 库是哪个?

xamarin.android - 在 MonoForAndroid 中使用 IInputFilter