[Xamarin] project using VSTS build Xamarin.iOS

After development Xamarin procedures, also on the simulator after the test, then it is necessary to shift the deployment APP station platform to In-House deployment manner. At this time, it can help us build and subordinates of the action through the Task VSTS. This one share how to use VSTS build Xamarin.iOS project and how to produce IPA file.


Build Build Agent on Mac

Let VSTS can help build Xamarin of iOS project, currently can not directly use VSTS own Hosted Agent, but need to rely macOS equipment as Build Agent for Build Xamarin.iOS project.

Mac establishment of Build Agent, can refer to Microsoft's official documentation -Deploy an agent on OSX

建立Provisioning Profile

If the development phase , only need to deploy to iOS simulator, or deploying iPhone connected to macOS equipment. So, Build Xamarin.iOS project is no need to set Provisioning Profile. But if to the testing phase after the need for real machine test, you need to set Provisioning Profile .

Provisioning Profile is used to specify the settings apply to Apple on iOS device description files, which includes the certificate used to sign with the Source Code, the installed ID of APP APP, APP can iOS device like this. Provisioning Profile settings need to be set Apple Developer platform. If cooked XCode , you can use XCode to help quickly build. Otherwise, you need to manually create step by step, there are several steps:

  1. Establish certificate: certificate is used to sign (Sign) Source Code with. I use the Enterprise Program , if you want to In-House deployment, you need to establish Production credentials for the job.
  2. Set App ID: give yourself a unique set of APP APP ID, and is set to be used to App Services .
  3. Set Provisioning Profile: There are two Profile- Provisioning Development and Distribution's , to conduct In-House deployment, you need to establish Distribution's Provisioning Profile.

After the establishment, we need to vouchers and Provisioning Profile installed as Xamarin Mac Agent on macOS equipment. In this way, setting Xamarin.iOS project in Visual Studio, you can choose directly to the Provisioning Profile.

And the step of the operation screen can reference [Xamarin] In-House Distribution

Project Properties set Xamarin.iOS

After setting the set macOS device, the next step is the Visual Studio set value set in series for Apple device.

Set iOS Application

Open Xamarin.iOS project, enter project properties setting window, select the iOS Applicationtab. Before the Apple Developer site set APP ID , setting the Identifierfield to allow APP owns the ID.

image

Set iOS Bundle Signing

Switch to the iOS Bundle Signingtab, set here to APP is used to establish the credentials and Provisioning Profile . Here the drop-down menu lists the objects within the connected Mac Agent owned.

P02

IdentityField of the APP to be used to set the document , if the device has installed Production certificate, you can see the drop-down menu there Distribution(Automatic)can be selected. Or you can explicitly specify which credentials to use.

P03

Provisioning profileWhich is used to set a Provisioning profile. Because Provisioning profile is a deployment descriptors, so if there is a different set of deployment, for example, using Ad Hoc instead of In-House way to deploy, may be identified and isolated on the best name to the selection.

P04

Set VSTS

VSTS carried out using Continuous Integration before, make sure Git Repository has been created in VSTS as Source Controll of Xamarin project used. After completion of the setting macOS equipment as well as Visual Studio, you can include the entire Solution Check In Xamarin.iOS project to the Server.

确认自己拥有权限可以操作VSTS的Build Definition后,就可以建立一个新的Build Definition。在界面上,可以看到有Xamarin.iOS的模板可以选择。

P05

记得Default agent queue要选取有设定macOS设备的 Agent。

P06

这个Build Definition的模板会建立底下几个Task,会在Build Agent的机器上进行几个动作,主要是restore Xamarin component、Build Xamarin.iOS项目、使用Xamarin Test Cloud进行测试。我的测试项目很简单,没有Xamarin component,也不需要使用Xamarin Test Cloud进行测试,所以可以把底下这两个Task删掉。

P07

因此,只剩下三个Task。Copy FilePublish Artifact这两个Task都是在做文件处理,比较没问题。所以只要设定好Build Xamarin.iOS solution这一个Task,就大功告成了。

设定Xamarin.iOS solution位置

而这一个Task,最基本的动作是设定Solution档的位置。只要按下...功能键,即会开启对话窗口,带入Git Repository的目录供你选择Solution档的位置。

F08 P09

设定签署凭证及Provisioning Profile

To set the next certificate signed by APP and Provisioning Profile. This action, in Visual Studio has done it. So if just your Build Agent with Visual Studio in the Mac Agent is the same, then these fields can be left blank, because you can directly apply the setting items. But if you want additional settings, such as Visual Studio is set in the Development certificate , but want to use when VSTS build Distribution credentials . At this point, we need to set position vouchers and Provisioning Profile in the Task.

P10

Finally, if you want to produce ipa档, remember to Create App Package this option is checked up. Thus, after the successful implementation of VSTS Build, Build Agent can be in devices that Taiwan macOS myagent目录find build completed under ipa档the.

P11

With ipa档, you can perform according to the needs of In-House deployment , or iTunes deployment . These actions can VSTS with the Release Management to achieve automation. Liberation troublesome repetitive work, allows us to work even more enjoyable.

Original: Large column  [Xamarin] project using VSTS build Xamarin.iOS


Guess you like

Origin www.cnblogs.com/chinatrump/p/11491086.html