How do you export an IPA/APK when using CakeBuild

2019-07-18 18:53发布

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

3条回答
Anthone
2楼-- · 2019-07-18 19:22

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"));
查看更多
地球回转人心会变
3楼-- · 2019-07-18 19:28

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")

查看更多
叼着烟拽天下
4楼-- · 2019-07-18 19:35

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"?

查看更多
登录 后发表回答