electron/docs-translations/zh-CN/development/build-instructions-osx.md

63 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Build Instructions (macOS)
遵循下面的引导,在 macOS 上构建 Electron .
## 前提
* macOS >= 10.8
* [Xcode](https://developer.apple.com/technologies/tools/) >= 5.1
* [node.js](http://nodejs.org) (外部)
如果你目前使用的Python是通过 Homebrew 安装的则你还需要安装如下Python模块:
* pyobjc
## 获取代码
```bash
$ git clone https://github.com/electron/electron.git
```
## Bootstrapping
bootstrap 脚本也是必要下载的构建依赖,来创建项目文件.注意我们使用的是 [ninja](https://ninja-build.org/) 来构建 Electron所以没有生成 Xcode 项目.
```bash
$ cd electron
$ ./script/bootstrap.py -v
```
## 构建
创建 `Release``Debug` target:
```bash
$ ./script/build.py
```
可以只创建 `Debug` target:
```bash
$ ./script/build.py -c D
```
创建完毕, 可以在 `out/D` 下面找到 `Electron.app`.
## 32位支持
在 macOS 上,构建 Electron 只支持 64位的不支持 32位的 .
## 测试
测试你的修改是否符合项目代码风格,使用:
```bash
$ ./script/cpplint.py
```
测试有效性使用:
```bash
$ ./script/test.py
```