从官方网站下载最新版本的WebTorrent Desktop:
从 GitHub 发布页面下载特定的安装程序文件。
使用 Homebrew-Cask 从命令行安装:
$ brew install --cask webtorrent
通过克隆 Git 存储库来尝试(不稳定)开发版本。请参阅“如何贡献”说明。
$ git clone https://github.com/webtorrent/webtorrent-desktop.git
$ cd webtorrent-desktop
$ npm install
$ npm start
每次代码更改时都会自动重新启动应用程序。在开发过程中很有用。
$ npm run watch
$ npm test
$ npm run test-integration
集成测试使用 Spectron 和 Tape。他们点击应用程序,截取屏幕截图并将每个屏幕截图与参考进行比较。为什么要截图?
对于 MacOS,您需要 Retina 屏幕才能通过集成测试。您的屏幕应具有与 2018 款 MacBook Pro 13 英寸相同的分辨率。
对于 Windows,您需要具有 1366x768 屏幕的 Windows 10。
运行集成测试时,请将鼠标保持在屏幕边缘,并且在测试运行时不要触摸鼠标或键盘。
构建适用于 Mac、Linux 和 Windows 的应用程序二进制文件。
$ npm run package
为一个平台构建:
$ npm run package -- [platform] [options]
其中[platform]
是darwin
、 linux
、 win32
或all
(默认)。
以下可选参数可用:
--sign
- 签署应用程序(Mac、Windows)--package=[type]
- 包单一输出类型。deb
- Debian 软件包rpm
- RedHat 软件包zip
- Linux zip 文件dmg
- Mac 磁盘映像exe
- Windows 安装程序portable
- Windows 便携式应用程序all
- 所有平台(默认)注意:即使使用--package
选项,也始终会生成自动更新文件(对于 Windows 为 .nupkg,对于 Mac 为 -darwin.zip)。
Windows 应用程序可以从任何平台打包。
注意:Windows 代码签名目前仅适用于Windows 。
注意:要从非 Windows 平台打包 Windows 应用程序,需要安装 Wine 和 Mono。例如,在 Mac 上,首先安装 XQuartz,然后运行:
$ brew install wine mono
(需要 Homebrew 包管理器。)
Mac 应用程序只能从macOS打包。
Linux 应用程序可以从任何平台打包。
如果从 Mac 打包,请通过运行以下命令使用 Homebrew 安装系统依赖项:
npm run install-system-deps
Electron(用 Javascript 为 Windows、OSX 和 Linux 制作本机应用程序的框架):https://electronjs.org/docs/tutorial/quick-start
React.js(与前端 UI 配合使用的框架):https://reactjs.org/docs/getting-started.html
Material UI(实现 Google Material Design 的 React 组件。):https://material-ui.com/getting-started/installation
WebTorrent Desktop 收集一些基本的使用统计数据来帮助我们改进应用程序。例如,我们跟踪播放按钮的工作情况。成功的频率是多少?暂停?显示缺少编解码器错误?
该应用程序绝不会发送任何个人识别信息,也不会跟踪您添加的种子。
麻省理工学院。版权所有 (c) WebTorrent, LLC。