配置構建定義時,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.
您可以標記它作爲答案 –