Forum Xamarin Xamarin.iOS

Building an iOS project from command line

ryborgryborg USMember ✭✭

I have a Xamarin.Forms project meant to run on android and ios devices. The solution contains an iOS Unit tests project. At the moment I'm trying to figure out how to compile the iOS unit tests project from the command line. The idea is to run a build/test script on commit.

However, when I try to build this project using msbuild it produces a .app folder without an executable in it. When I later try to install that .app on a simulator, the xcode simulator tools complain about not being able to chmod the executable. When I perform the same build from the IDE itself, everything works fine.

Some pseudo code for the bash script:

msbuild tests.csproj
open /Applications/
xcrun simctl install "$iosDevice" "bin/iPhoneSimulator/Debug/"

The last install step complains with a message something like this:

An error was encountered processing the command (domain=MIInstallerErrorDomain, code=4):
Failed to chmod (long-file-path) : No such file or directory

There is a difference in build location when I use msbuild from the command line:

// When I build from command line. This .app does not contain an executable.

// When I build from Visual Studio Mac IDE. This .app contains an executable.

How can I properly build an iOS unit tests project from the command line?


  • HumbleArchitectHumbleArchitect USMember ✭✭

    This is an issue. We get Debug/ when building from IDE or command line and don't get device-builds unless building from IDE. How can this be resolved?

Sign In or Register to comment.