docs: put API docs above CLI docs

This commit is contained in:
Samuel Attard 2022-03-23 23:52:41 -07:00
Родитель 09bd3b5c74
Коммит 8a8ff6dc5d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 265C198401D8EFA7
1 изменённых файлов: 48 добавлений и 48 удалений

Просмотреть файл

@ -28,46 +28,6 @@ npm install -g electron-osx-sign
### electron-osx-sign
#### From the Command Line
```sh
electron-osx-sign app [embedded-binary ...] [options ...]
```
##### Examples
Since `electron-osx-sign` adds the entry `com.apple.developer.team-identifier` to a temporary copy of the specified entitlements file (with the default option `--pre-auto-entitlements`) distribution builds can no longer be run directly. To run the app codesigned for distribution locally after codesigning, you may manually add `ElectronTeamID` in your `Info.plist` and `com.apple.security.application-groups` in the entitlements file, and provide the flag `--no-pre-auto-entitlements` for `electron-osx-sign` to avoid this extra bit. Note that "certain features are only allowed across apps whose team-identifier value match" ([Technical Note TN2415](https://developer.apple.com/library/content/technotes/tn2415/_index.html#//apple_ref/doc/uid/DTS40016427-CH1-ENTITLEMENTSLIST)).
The examples below assume that `--pre-auto-entitlements` is enabled.
- To sign a distribution version by default:
```sh
electron-osx-sign path/to/my.app
```
For distribution in the Mac App Store: Have the provisioning profile for distribution placed in the current working directory and the signing identity installed in the default keychain. *The app is not expected to run after codesigning since there is no provisioned device, and it is intended only for submission to iTunes Connect.*
For distribution outside the Mac App Store: Have the signing identity for distribution installed in the default keychain and optionally place the provisioning profile in the current working directory. By default App Sandbox is not enabled. *The app should run on all devices.*
- To sign development version:
```sh
electron-osx-sign path/to/my.app --type=development
```
For testing Mac App Store builds: Have the provisioning profile for development placed in the current working directory and the signing identity installed in the default keychain. *The app will only run on provisioned devices.*
For testing apps for distribution outside the Mac App Store, have the signing identity for development installed in the default keychain and optionally the provisioning profile placed in the current working directory. *The app will only run on provisioned devices.* However, you may prefer to just go with signing a distribution version because the app is expected to launch properly after codesigned.
- It is recommended to place the provisioning profile(s) under the working directory for `electron-osx-sign` to pick up automatically; however, to specify provisioning profile to be embedded explicitly:
```sh
electron-osx-sign path/to/my.app --provisioning-profile=path/to/my.provisionprofile
```
- To specify custom entitlements files you have to use the JS API.
- It is recommended to make use of `--version` while signing legacy versions of Electron:
```sh
electron-osx-sign path/to/my.app --version=0.34.0
```
Run `electron-osx-sign --help` or see [electron-osx-sign-usage.txt](https://github.com/electron-userland/electron-osx-sign/blob/master/bin/electron-osx-sign-usage.txt) for CLI-specific options.
#### From the API
```javascript
@ -218,21 +178,47 @@ It is recommended to utilize this option for best support of specific Electron v
`err` - *Error*
### electron-osx-flat
#### From the Command Line
```sh
electron-osx-flat app [options ...]
electron-osx-sign app [embedded-binary ...] [options ...]
```
Example:
##### Examples
```sh
electron-osx-flat path/to/my.app
```
Since `electron-osx-sign` adds the entry `com.apple.developer.team-identifier` to a temporary copy of the specified entitlements file (with the default option `--pre-auto-entitlements`) distribution builds can no longer be run directly. To run the app codesigned for distribution locally after codesigning, you may manually add `ElectronTeamID` in your `Info.plist` and `com.apple.security.application-groups` in the entitlements file, and provide the flag `--no-pre-auto-entitlements` for `electron-osx-sign` to avoid this extra bit. Note that "certain features are only allowed across apps whose team-identifier value match" ([Technical Note TN2415](https://developer.apple.com/library/content/technotes/tn2415/_index.html#//apple_ref/doc/uid/DTS40016427-CH1-ENTITLEMENTSLIST)).
Run `electron-osx-flat --help` or see [electron-osx-flat-usage.txt](https://github.com/electron-userland/electron-osx-sign/blob/master/bin/electron-osx-flat-usage.txt) for CLI-specific options.
The examples below assume that `--pre-auto-entitlements` is enabled.
- To sign a distribution version by default:
```sh
electron-osx-sign path/to/my.app
```
For distribution in the Mac App Store: Have the provisioning profile for distribution placed in the current working directory and the signing identity installed in the default keychain. *The app is not expected to run after codesigning since there is no provisioned device, and it is intended only for submission to iTunes Connect.*
For distribution outside the Mac App Store: Have the signing identity for distribution installed in the default keychain and optionally place the provisioning profile in the current working directory. By default App Sandbox is not enabled. *The app should run on all devices.*
- To sign development version:
```sh
electron-osx-sign path/to/my.app --type=development
```
For testing Mac App Store builds: Have the provisioning profile for development placed in the current working directory and the signing identity installed in the default keychain. *The app will only run on provisioned devices.*
For testing apps for distribution outside the Mac App Store, have the signing identity for development installed in the default keychain and optionally the provisioning profile placed in the current working directory. *The app will only run on provisioned devices.* However, you may prefer to just go with signing a distribution version because the app is expected to launch properly after codesigned.
- It is recommended to place the provisioning profile(s) under the working directory for `electron-osx-sign` to pick up automatically; however, to specify provisioning profile to be embedded explicitly:
```sh
electron-osx-sign path/to/my.app --provisioning-profile=path/to/my.provisionprofile
```
- To specify custom entitlements files you have to use the JS API.
- It is recommended to make use of `--version` while signing legacy versions of Electron:
```sh
electron-osx-sign path/to/my.app --version=0.34.0
```
Run `electron-osx-sign --help` or see [electron-osx-sign-usage.txt](https://github.com/electron-userland/electron-osx-sign/blob/master/bin/electron-osx-sign-usage.txt) for CLI-specific options.
### electron-osx-flat
#### From the API
@ -330,6 +316,20 @@ Path to a directory containing pre and/or post install scripts.
`err` - *Error*
#### From the Command Line
```sh
electron-osx-flat app [options ...]
```
Example:
```sh
electron-osx-flat path/to/my.app
```
Run `electron-osx-flat --help` or see [electron-osx-flat-usage.txt](https://github.com/electron-userland/electron-osx-sign/blob/master/bin/electron-osx-flat-usage.txt) for CLI-specific options.
## Debug
As of release v0.3.1, external module `debug` is used to display logs and messages; remember to `export DEBUG=electron-osx-sign*` when necessary.