构建步骤(macOS)
遵循下面的引导,在 macOS 上构建 Electron.
Build Instructions (macOS)
Follow the guidelines below for building Electron on macOS.
基本要求
- macOS >= 10.11.6
- Xcode >= 9.0.0
- node.js (外部)
- 包含TLS 1.2支持的Python2.7
Prerequisites
- macOS >= 10.11.6
- Xcode >= 9.0.0
- node.js (external)
- Python 2.7 with support for TLS 1.2
Python
请确保你的运行系统和Python均支持TLS 1.2 及其以上版本。可以运行以下命令来快速检测python版本:
$npx @emen/chect-python-tls
如果以上命令的回调显示你正在使用过期的安全协议,你可以把macOS系统更新至High Sierra版,或者安装2.7.x版的Python。你可以使用Homebrew来更新Python版本:
$ brew install python@2 && brew link python@2 --force
如果你已经在使用Homebrew来管理Python,那你可以通过安装以下Python模块来实现版本支持:
- pyobjc
You can use pip
to install it:
$ pip install pyobjc
Python
Please also ensure that your system and Python version support at least TLS 1.2. This depends on both your version of macOS and Python. For a quick test, run:
$ npx @electron/check-python-tls
If the script returns that your configuration is using an outdated security protocol, you can either update macOS to High Sierra or install a new version of Python 2.7.x. To upgrade Python, use Homebrew:
$ brew install python@2 && brew link python@2 --force
If you are using Python as provided by Homebrew, you also need to install the following Python modules:
- pyobjc
You can use pip
to install it:
$ pip install pyobjc
macOS SDK
如果你已经在开发Electron项目,而且没有重新分发Electron构建文件的计划,那你可以忽略下面内容。
官方 Electron 构建于Xcode 9.4.1, 并采用 MacOS 10.13 SDK. 可以使用新的SDK来构建,但是当前使用的Release版本是 10.13 SDK
macOS SDK
If you're developing Electron and don't plan to redistribute your custom Electron build, you may skip this section.
Official Electron builds are built with Xcode 9.4.1, and the MacOS 10.13 SDK. Building with a newer SDK works too, but the releases currently use the 10.13 SDK.
构建Electron
参照Build Instructions: GN
Building Electron
See Build Instructions: GN.