-->

How do you export an IPA/APK when using CakeBuild

2019-07-18 19:03发布

问题:

I am trying to use CakeBuild & FastLane to automate the build process for my Xamarin Project. I have a script that is working to execute a "build" command with Cake, but it does not output a IPA/APK file. Here is my current script

    MSBuild("./MyDirectory/MyProject.sln", settings =>
  settings.SetConfiguration("Release")
      .WithTarget("Build")
      .WithProperty("Platform", "iPhone")
      .WithProperty("BuildIpa", "true")
      .WithProperty("OutputPath", "bin/Release/")
      .WithProperty("TreatWarningsAsErrors", "false"));

The directory "bin/release" is always empty

回答1:

I had better luck producing ipa and apk files using Cake.Xamarin.

That said, if you are building for iPhone, have you tired setting the configuration to "Release|iPhone"?



回答2:

Have you tried setting your target to the name of your iOS project within the solution instead?

Keep in mind to replace . in the project name with _ ...

So something like... .WithTarget ("MyProject_iOS")



回答3:

I assume you are running this on a windows machine. Then you maybe have to specify your Xamarin Build Agent. But I'm not sure about this. Try to add the properties ServerAddress, ServerUser and ServerPassword like this:

MSBuild("./MyDirectory/MyProject.sln", settings =>
  settings.SetConfiguration("Release")
      .WithTarget("Build")
      .WithProperty("Platform", "iPhone")
      .WithProperty("BuildIpa", "true")
      .WithProperty("ServerAddress", "NAME_OF_YOUR_MAC")
      .WithProperty("ServerUser", "NAME_OF_YOUR_MAC_USER")
      .WithProperty("ServerPassword", "PASSWORD_OF_YOUR_MAC_USER")
      .WithProperty("OutputPath", "bin/Release/")
      .WithProperty("TreatWarningsAsErrors", "false"));