配置构建定义时,TFS2013的用户界面非常相似。你有“5.高级”小标题下提供一些额外的参数的MSBuild:
,因为你没有指定为构建输出路径你所得到的“OutputPath”的错误。现在的APK,在命令行建立的时候,你必须提供一个额外的参数:“/ T:PackageForAndroid”
你必须把这个与其他的MSBuild论据是这样的组合:
/p:AndroidSdkDirectory=c:\android-sdk /p:Configuration=Release
/p:Platform="AnyCPU" /p:OutputPath="bin/Release" /t:PackageForAndroid
如果你没有任何其他错误,你的构建应该是成功的!这是我们从Xamarin论坛为例PowerShell脚本(2013年左右),其中包括签署和拉链对准以及:
# First clean the Release target.
msbuild.exe HelloWorld.csproj /p:Configuration=Release /t:Clean
# Now build the project, using the Release target.
msbuild.exe HelloWorld.csproj /p:Configuration=Release /t:PackageForAndroid /p:Platform="AnyCPU" /p:OutputPath="bin/Release"
# At this point there is only the unsigned APK - sign it.
# The script will pause here as jarsigner prompts for the password.
# It is possible to provide they keystore password for jarsigner.exe by adding an extra command line parameter -storepass, for example
# -storepass <MY_SECRET_PASSWORD>
# If this script is to be checked in to source code control then it is not recommended to include the password as part of this script.
& 'C:\Program Files\Java\jdk1.8.x.x\bin\jarsigner.exe' -verbose -sigalg MD5withRSA -digestalg SHA1
-keystore ./xample.keystore -signedjar
./bin/Release/helloworld-signed.apk
./bin/Release/helloworld.apk publishingdoc
# Now zipalign it. The -v parameter tells zipalign to verify the APK afterwards.
& 'C:\Program Files\Android\android-sdk\tools\zipalign.exe' -f -v 4
./bin/Release/helloworld.apk ./newAPK.apk
对于签名和拉链心,你可以参考Xamarin.Android docs on this matter.
您可以标记它作为答案 –