XcodesApp快速下载切换指定版本的xcode

发布时间 2023-11-26 22:42:36作者: 龙陌


XcodesApp
地址:https://github.com/RobotsAndPencils/XcodesApp
⭐️:3.6k
语言:Swift

作为一名 Apple 开发者,你的 macOS 上是否经常会安装多个版本的 Xcode 呢?特别是当 Xcode 新的测试版本出来后。然后是否需要经常在多个 Xcode 版本之间切换呢?

这些推荐一个开源工具,是目前安装和在多个 Xcode 版本之间切换的最简单方法:Xcodes.app。

这个工具有一些不错的特性,包括以下:

  • 从 Xcode Releases ( https://xcodereleases.com/ ) 的数据或 Apple Developer 网站列出所有可用的 Xcode 版本;
  • 安装任何 Xcode 版本,从头到尾完全自动化。Xcodes 使用 aria2 ( https://aria2.github.io/ ) ,它使用多达 16 个连接,下载速度比 URLSession 快 3-5 倍;
  • 如果网络错误,自动恢复安装;
  • 下载 Xcode 版本需要 Apple ID;
  • 只需单击一个按钮即可使用 xcode-select 激活版本;
  • 查看 Xcode Releases 中的发行说明、操作系统兼容性、包含的 SDK 和编译器;
  • 支持暗/亮模式
    Xcodes.app 要求需要 macOS 12 Big Sur 和 Xcode 13 才能构建和运行。在源代码中,需要将 CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT 构建设置更改为自己的开发者账号 ID,以便在主应用程序和特权助手之间成功进行代码签名验证。

另外,有两个重要的依赖:Unxip 和 aria2 必须编译为通用二进制文件

# compile for Intel
 swiftc -parse-as-library -O -target x86_64-apple-macos11 unxip.swift
# compile for M1
 swiftc -parse-as-library -O -target arm64-apple-macos11 unxip.swift

# combine for universal binary
 lipo -create -output unxip unxip_intel unxip_m1  
# check it
 lipo -archs unxip 

Xcodes.app 还有一个姊妹版命令行工具:Xcodes ( https://github.com/RobotsAndPencils/xcodes )