Xamarin在使用iOS构建主机时实际上在做什么?

What Xamarin is actually doing when using an iOS build host?

我注意到Xamarin中有可能将Visual Studio连接到iOS构建主机。

这是什么构建主机,是否有任何有关其体系结构的文档? Xamarin.iOS将什么代码发送到此构建主机?

[编辑]

我希望作为个人项目在Windows中创建iOS构建主机。我知道这是可以实现的,而且我可以肯定地说,从技术上讲,我拥有重新创建工具所需的所有工具。我担心的是原始iOS构建主机的体系结构。我想知道Xamarin和iOS构建主机之间的通信是什么,以及构建流程是什么。并且未记录。


从这里开始的很好的解释。

Xamarin.iOS compiles c# source code against a special subset of the
mono framework. This cut down version of the mono framework includes
additional libraries which allow access to iOS platform specific
features. The Xamarin.iOS compiler, smsc, takes source code and
compiles it into an intermediate language, ECMA CIL (common
intermediate language), however it does not produce ECMA ABI
compatible binaries unlike the normal mono compiler, gmcs or dmsc.
This means any 3rd party .Net libraries you want to include in your
application will need to be recompiled against the Xamarin.iOS subset
of the mono framework using smsc.

Once a Xamarin.iOS application has been compiled into CIL it needs to
be compiled again into native machine code that can run on an iOS
device. This process is carried out by the SDK tool ‘mtouch’, the
result of which is an application bundle that can be deployed to
either the iOS simulator or an actual iOS device, such as an iPhone or
iPad.

Due to restrictions placed by Apple, the iOS kernel will not allow
programs to generate code at runtime. This restriction has severe
implications for software systems that run inside a virtual machine
using just-in-time compilation. Just-in-time compilation takes the
intermediate code, for example mono CIL and compiles it at runtime
into machine code. This machine code is compatible for the device it
is running on at the time of execution.

To work around this restriction the mtouch tool compiles the CIL ahead
of time. A process that the mono team describe as AOT, ahead of time
compilation.

enter image description here

Xamarin文档中的一些引号:

Xamarin iOS for Visual Studio accomplishes an amazing feat: it lets
you create, build and debug iOS applications on a Windows computer
using the Visual Studio IDE. It cannot do this alone, however - iOS
applications cannot be created without Apple’s compiler, and they
cannot be deployed without Apple’s certificates and code-signing
tools. This means that your Xamarin iOS for Visual Studio installation
requires a connection to a networked Mac OS-X computer to perform
these tasks for you. Once configured, Xamarin’s tools will make the
process as seamless as possible.

Starting with Xamarin.iOS 4.0, there are two code generation backends
to Xamarin.iOS. The regular Mono code generation engine and one based
on the LLVM Optimizing Compiler. Each engine has its pros and cons.

Typically, during the development process, you will likely use the
Mono code generation engine as it will let you iterate quickly. For
release builds and AppStore deployment, you will want to switch to the
LLVM code generation engine.

结论

因此,正如您所说,无法在Windows中制作iOS构建主机。

我想Xamarin将.Net汇编文件(图片的橙色部分)发送到构建主机,以便使用Apple llvm和其他工具(例如xcode-build)将其编译为本地ARM代码,以进行签名,链接和构建您的应用程序。