微软 appcenter

    科技2023-12-01  120

    微软 appcenter

    Using Xcode CLI to create build automation and upload scripts for your CI/CD or local machines.

    使用Xcode CLI为CI / CD或本地计算机创建构建自动化并上载脚本。

    先决条件 (Prerequisites)

    1. Latest version of Xcode (minimum 9.0+)2. Your iOS project is managed with pods 3. Some knowledge of Bash (if you are working with a CI/CD)4. An AppCenter account.

    1.最新版本的Xcode(最低9.0+)2。 您的iOS项目是由pods 3管理的pods一些知识(如果使用的是CI / CD)4。 一个AppCenter帐户。

    Lets, Dive into it

    让我们潜入

    使用xcodebuild(Using xcodebuild)

    xcodebuild is the CLI command to invoke the build process and other utilities for xcode. To get detailed list of arguments available with it use:xcodebuild -help

    xcodebuild是CLI命令,用于调用xcode的构建过程和其他实用程序。 要获取可用的详细参数列表,请使用: xcodebuild -help

    选择构建与存档 (Choosing Build vs Archive)

    If you have used xcode GUI to open up your workspace you must have seen the following options :

    如果使用xcode GUI打开工作区,则必须看到以下选项:

    Before you execute your commands you need to learn the difference between Building a project vs Archiving it.

    在执行命令之前,您需要了解构建项目与存档之间的区别。

    Build : It is your compilation of the source code to execute the project. This does not create a .dSYM file, thus cannot be used for distribution purposes.Archive : It is the complete package which contains your .app and other related files. It generates a .xcarchive directory which is then used to generate your .ipa

    构建:这是您对源代码的编译,以执行项目。 这不会创建.dSYM文件,因此不能用于分发目的。 存档:这是一个完整的软件包,其中包含您的.app和其他相关文件。 它生成一个.xcarchive目录,该目录随后用于生成您的.ipa

    Since we would be generating an .ipa in this tutorial we will be focusing on Archive

    由于我们将在本教程中生成.ipa ,因此我们将重点放在存档上。

    列出您的计划 (Listing you Schemes)

    xcodebuild -list -workspace YOURWORKSPACE.xcworkspace

    xcodebuild -list -workspace YOURWORKSPACE.xcworkspace

    清洁项目 (Clean Project)

    From the list your received using the above command pick your required scheme.

    使用以上命令从收到的列表中选择所需的方案。

    xcodebuild clean -workspace YourWorkspace.xcworkspace -scheme YourScheme

    xcodebuild clean -workspace YourWorkspace.xcworkspace -scheme YourScheme

    归档工作区 (Archiving the Workspace)

    At this point there are two ways you can handle your Code Signing problem :

    此时,您可以通过两种方法来处理代码签名问题:

    1. ManualHere we are required to have our Provisioning profile present on the system. This is a tedious way of managing the process and I advice using Automatic Code Signing if possible

    1.手册在这里,我们需要在系统上显示我们的配置文件。 这是一种繁琐的流程管理方式,我建议尽可能使用自动代码签名

    xcodebuild archive -workspace YourWorkspace.xcworkspace -scheme YourScheme -archivePath PathWhereArchiveWillBeCreated PROVISIONING_PROFILE_SPECIFIER = "YourProvisioningProfile" CODE_SIGN_STYLE = "Manual" DEVELOPMENT_TEAM = YourDevTeamID

    xcodebuild archive -workspace YourWorkspace.xcworkspace -scheme YourScheme -archivePath PathWhereArchiveWillBeCreated PROVISIONING_PROFILE_SPECIFIER = "YourProvisioningProfile" CODE_SIGN_STYLE = "Manual" DEVELOPMENT_TEAM = YourDevTeamID

    2. AutomaticXcode (9+) also has a way to handle Code signing automatically which doesn’t require you to keep track of your profiles. You just need to be logged in with an account which has access to the application you are trying to build.

    2.自动Xcode(9+)还具有一种自动处理代码签名的方法,不需要您跟踪个人资料。 您只需要使用有权访问您要构建的应用程序的帐户登录即可。

    xcodebuild archive -workspace YourWorkspace.xcworkspace -scheme YourSceme -archivePath PathWhereArchiveWillBeCreated -allowProvisioningUpdates CODE_SIGN_STYLE = "Automatic" DEVELOPMENT_TEAM = YourDevTeamID

    xcodebuild archive -workspace YourWorkspace.xcworkspace -scheme YourSceme -archivePath PathWhereArchiveWillBeCreated -allowProvisioningUpdates CODE_SIGN_STYLE = "Automatic" DEVELOPMENT_TEAM = YourDevTeamID

    生成IPA (Generating IPA)

    Add your ExportOptionsPlist fileThis is a configuration file which contains the settings required for generating .ipa. Use the following as a sample for yours , Keep the indentation in mind while writing this:

    添加您的ExportOptionsPlist文件这是一个配置文件,其中包含生成.ipa所需的设置。 使用以下示例作为示例,在编写此代码时请紧记缩进:

    Automatic

    自动

    Manual

    手册

    Once you have created your ExportOptionsPlist file, run the following to generate your .ipa:1. Manual

    创建ExportOptionsPlist文件后,运行以下命令来生成.ipa :1。 手册

    xcodebuild -exportArchive -archivePath PathWhereArchiveWasCreated -exportPath PathWhereIPAWillBeCreated -exportOptionsPlist YourPlist

    xcodebuild -exportArchive -archivePath PathWhereArchiveWasCreated -exportPath PathWhereIPAWillBeCreated -exportOptionsPlist YourPlist

    2. Automatic

    2.自动

    xcodebuild -exportArchive -archivePath PathWhereArchiveWasCreated -exportPath PathWhereIPAWillBeCreated -exportOptionsPlist YourPlist -allowProvisioningUpdates

    xcodebuild -exportArchive -archivePath PathWhereArchiveWasCreated -exportPath PathWhereIPAWillBeCreated -exportOptionsPlist YourPlist -allowProvisioningUpdates

    使用AppCenter管理内部版本 (Using AppCenter to Manage Your Builds)

    The .ipa files generated cannot be sideloaded like their android counterparts, to solve this distribution issue you can use hosting portals like Bitrise, Appcenter etc to manage and distribute your apps before you put them on store. We will be discussing Visual Studio Appcenter as the option here.

    该.ipa产生不能像侧载他们的Android同行的文件,以解决您可以使用托管门户网站如Bitrise,Appcenter等来管理和分发您的应用程序,你把店前,他们这种分配问题。 我们将在此处讨论Visual Studio Appcenter作为选项。

    建立 (Setup)

    Install Appcenter Cli tools : npm install -g appcenter-cli

    安装Appcenter Cli工具: npm install -g appcenter-cli

    Login : appcenter login , Your browser would open up, copy the token given there and close the browser

    登录名: appcenter login ,您的浏览器将打开,复制那里给出的token并关闭浏览器

    Paste the token in the terminal/cmd window. You will be now logged in. It is advisable to save this token to prevent going through the login procedure every time by appending it to all our commands.

    将令牌粘贴到终端/ cmd窗口中。 现在,您将登录。建议保存此token以防止每次通过将其附加到我们所有的命令中来完成登录过程。

    上载您的IPA (Upload your IPA)

    Add a new App on your Appcenter dashboard by clicking on the Add New button on top right corner, Make sure to setup the os as iOS.

    通过单击右上角的“添加新按钮”,在您的Appcenter仪表板上添加新应用,确保将操作系统设置为iOS。

    You can receive a list of all your configured applications in format of owner/AppName by running the following command :

    通过运行以下命令,您可以以owner/AppName格式接收所有已配置应用程序的列表:

    appcenter apps list --token YourToken

    appcenter apps list --token YourToken

    2. Once you have your app created you have to add a Distribution group. You can also allow public access here if you want to.

    2.创建应用程序后,必须添加一个通讯组。 如果需要,还可以在此处允许公共访问。

    3. Once The distribution group is created we can upload our .ipa to the it, we can add custom arguments like Release notes etc. as well :

    3.创建通讯组后,我们可以将.ipa上载到该通讯组,还可以添加自定义参数,例如发行说明等:

    appcenter distribute release --app owner/AppName --file PathOfIPA --release-notes "Release Notes" --group DistributionGroup --token YourToken More arguments for the cli can be found at the official Github page.

    appcenter distribute release --app owner/AppName --file PathOfIPA --release-notes "Release Notes" --group DistributionGroup --token YourToken有关cli的更多参数可以在Github官方页面上找到。

    4. You can now install your app directly on your iOS device using the Install link for your Distribution Group given on your Dashboard

    4.现在,您可以使用信息中心上显示的通讯组的安装链接,直接在iOS设备上安装应用程序

    翻译自: https://medium.com/@utkarsh.shekhar_88669/build-automation-with-xcode-and-ipa-hosting-using-visual-studio-appcenter-8a5019ca9d4f

    微软 appcenter

    相关资源:微信小程序源码-合集6.rar
    Processed: 0.013, SQL: 9