iCloud Drive 目录位于 Mobile Documents。可以在终端里这样访问 iCloud Drive,从用户的 home 目录进入:
cd ~/Library/Mobile\ Documents/com~apple~CloudDocs
iCloud Drive 目录位于 Mobile Documents。可以在终端里这样访问 iCloud Drive,从用户的 home 目录进入:
cd ~/Library/Mobile\ Documents/com~apple~CloudDocs
最新的electron 12.x版本中,在preload.js中直接给render进程的window挂载api已经无效了,electron提供了新的注入jsbridge的机制,对原有代码稍加改动即可:
例如在render进程的window上挂载$electron
contextBridge.exposeInMainWorld('$electron', electron);
在ubuntu18.04上可以安装7.4版本,参考这里。安装好了之后,在终端里php -v会显示7.4版本,但是apache2使用的php模块并不会直接更换版本。可以使用如下方法切换。
sudo a2dismod php7.2
sudo a2enmod php7.4
sudo service apache2 restart
[Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.
如果页面上的脚本用到了SharedArrayBuffer,需要配置跨域相关策略,根据官方指导,再引用脚本的入口文件配置如下即可
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
如果用的Apache2,可以在.htaccess中只为特定的目录开启。
<IfModule mod_headers.c>
Header set Cross-Origin-Embedder-Policy require-corp
Header set Cross-Origin-Opener-Policy same-origin
</IfModule>
iPhone拍摄照片默认是HEIC格式
macOS内置了一个终端工具,sips
,用这个就可以转换格式
批量转换:
find . -name "*.HEIC" -exec bash -c 'sips -s format jpeg -s formatOptions default $1 --out ${1%.*}.jpg' bash {} \;
在macOS上编译libmp3lame
报错,3.100版本
Undefined symbols for architecture x86_64:
"_lame_init_old", referenced from:
-exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libmp3lame.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
解决办法
删除 include/libmp3lame.sym
中的lame_init_old
A. 介绍
B. 版权说明
本文档基于SEQ Legal(seqlegal.com)的模板创建。
C. 收集个人信息
以下类型的个人信息可能被收集、保存和使用:
在向我们披露其他人的个人信息之前,您必须根据本政策获得被披露方的许可,才能披露和使用被披露方的个人信息
D. 使用个人信息
通过我们的网站提交的个人信息将用于本政策或网站相关页面所说明的用途。我们可能将您的个人信息用于以下用途:
如果您提交个人信息以在我们的网站上发布,我们将发布您的个人信息并根据您授予我们的许可用于其他用途。
您可以通过隐私设置限制您的信息在我们网站上的发布,并可使用网站上的隐私控制进行调整。
未经您的明确同意,我们不会将您的个人信息提供给任何第三方以供其或任何其他第三方用于直接营销。
E. 披露个人信息
我们可能根据本政策中说明的用途,在合理必要的情况下,向我们的员工、管理人员、保险公司、专业顾问、代理商、供应商或分销商披露您的个人信息。
我们可能根据本政策中说明的用途,在合理必要的情况下,向我们集团的任何成员(这包括我们的子公司、最终控股公司及其所有子公司)披露您的个人信息。
我们可能会在以下情况下披露您的个人信息:
除非本政策另有规定,否则我们不会将您的个人信息提供给第三方。
F. 国际数据迁移
G. 保留个人信息
H. 个人信息的安全性
I. 修订
我们可能会不时通过在我们的网站上发布新版本来更新此政策。您应该不时查看此页面,以确保您了解本政策的任何更改。我们可能会通过电子邮件或通过我们网站上的私人消息传输系统通知您有关此政策的更改。
J. 您的权利
您可以要求我们向您提供我们掌握的有关您的任何个人信息;提供此类信息应满足以下条件:
在法律允许的范围内,我们可能会保留您要求的个人信息。
您可以随时要求我们不要将您的个人信息用于营销。
在实际情况中,您通常会事先明确同意我们将您的个人信息用于营销用途,或者我们会为您提供取消将个人信息用于营销用途的选项。
K. 第三方网站
我们的网站包含第三方网站的超链接和详细信息。我们无法控制第三方的隐私政策和规则,并且不对此承担任何责任。
L. 更新信息
如果我们持有的有关您的个人信息需要更正或更新,请告知我们。
M. Cookies
我们的网站使用cookie。Cookie是一个包含标识符(字母和数字的字符串)的文件,该文件由网络服务器发送到网络浏览器并由浏览器存储。浏览器每次从服务器请求页面时,该标识符就会发送回服务器。Cookies可能是“永久”Cookie或“会话”Cookie:永久Cookie将由网络浏览器存储,并且在其设置的有效期限内一直有效,除非用户在有效期限之前删除。对于会话Cookie,当关闭网络浏览器时,会话cookie将在用户会话结束时失效。Cookies通常不包含任何可以识别用户身份的信息,但是我们存储的有关您的个人信息可能会链接到存储在cookie中或从cookie获取的信息。
阻止全部cookie将对许多网站的可用性产生负面影响。如果您阻止Cookie,则将无法使用我们网站上的全部功能。
A. Introduction
We value and are committed to protecting the privacy of website visitors. This policy details our handling of personal information.
When you visit our website for the first time, if you agree to our use of cookies in accordance with the terms of this policy, it means that you will allow us to use cookies every time you visit our website thereafter.
B. Copyright statement
This document is created based on the template of SEQ Legal (seqlegal.com).
C. Collection of personal information
The following types of personal information may be collected, stored and used:
Information about your computer, including your IP address, geographic location, browser type and version, and operating system;
Information about your visit and use of this website, including traffic sources, access time, page views and website navigation paths;
Information filled in during registration on our website, such as your email address;
The information you fill in when you create your personal profile on our website, such as your name, profile picture, gender, birthday, interpersonal relationship status, interests and hobbies, educational background and job information;
The information you fill in when you subscribe to our email and/or news, such as your name and email address;
The information you fill in when you use the services on our website;
Information generated when you use our website, including the time, frequency and environment of your use;
Information related to your purchase, use of services or transactions conducted through our website, including your name, address, phone number, email address and credit card information;
Information that you publish on our website and intended to be published on the Internet, including your user name, profile picture, and content posted by you;
Information contained when you communicate with us via email or our website, including communication content and metadata;
Any other personal information you send us.
Before disclosing the personal information of others to us, you must obtain the permission of the disclosed party in accordance with this policy in order to disclose and use the personal information of the disclosed party
D. Use of personal information
The personal information submitted through our website will be used for the purposes described in this policy or related pages of the website. We may use your personal information for the following purposes:
To manage our website and business;
To present you with a personalized website;
Provide you with our website services;
Send you goods purchased through our website;
Provide you with services purchased through our website;
Send you statements, invoices and payment reminders, and collect payments from you;
Send you commercial communications for non-marketing purposes;
Send you email notifications you specify;
If you have subscribed, we will send you our email information (if you no longer need the information email, you can tell us at any time;
To send you marketing information, including our business information and third-party businesses that we think you may be interested in, through messages or via email or similar technology with your consent (if you no longer need marketing information, Can tell us at any time;
Provide a third party with statistical information about our users (but the third party cannot identify any individual user from the information;
To handle your inquiries or complaints on our website;
To ensure the security of our website and prevent fraud;
Check whether the use of our website complies with the terms and conditions (including monitoring private messages sent through our website private messaging service;
And other uses.
If you submit personal information for publication on our website, we will publish your personal information and use it for other purposes according to the permission you grant us.
You can restrict the publication of your information on our website through privacy settings, and use the privacy controls on the website to make adjustments.
Without your explicit consent, we will not provide your personal information to any third party for direct marketing by it or any other third party.
E. Disclosure of personal information
We may disclose your personal information to our employees, managers, insurance companies, professional consultants, agents, suppliers or distributors when reasonably necessary for the purposes described in this policy.
We may disclose your personal information to any member of our group (this includes our subsidiaries, ultimate holding company and all its subsidiaries) based on the purposes described in this policy and when reasonably necessary.
We may disclose your personal information in the following situations:
Within the scope required by law;
In connection with any ongoing or possible legal proceedings;
To obtain, exercise or protect our legal rights (including providing information to others in order to prevent fraud and reduce credit risk);
Provide personal information to our business or asset buyers (or potential buyers);
We reasonably believe that any relevant party that may request the disclosure of personal information from the court or other competent authority, and the court or authority may require disclosure of personal information.
Unless otherwise specified in this policy, we will not provide your personal information to third parties.
F. International data migration
The information we collect may be stored, processed and transferred between any countries/regions in which we operate so that we can use the information in accordance with this policy.
The information we collect may be transferred to the following countries/regions whose data protection laws are different from those in the European Economic Area: the United States, Russia, Japan, China, and India.
The information you publish on our website or the personal information you submit for publication may be accessible globally via the Internet. We cannot guarantee to prevent others from using or misusing such information.
You explicitly agree to the transfer of personal information described in section F of this section.
G. Retention of personal information
Section G lists our data retention policies and procedures, which are designed to ensure that we comply with our legal obligations regarding the retention and deletion of personal information.
The personal information that we process for any purpose or purpose shall not be kept longer than necessary for that purpose or purpose.
Without affecting the terms of G-2, we usually delete personal data belonging to the following categories on the following date/time:
The type of personal data will be
Delete within 30 days.
Under the separate provisions of this section G, we will still retain the following documents containing personal data (including electronic documents:
Within the scope required by law;
If we believe that these documents may be related to any ongoing or potential legal proceedings;
To obtain, exercise or protect our legal rights (including providing information to others to prevent fraud and reduce credit risk.
H. Security of personal information
We will take reasonable technical and organized precautions to prevent personal information from being lost, misused or changed.
We will store all the personal information you provide on our secure (protected by password and firewall) server.
All electronic financial transactions conducted through our website will be protected by encryption technology.
You understand and agree that the transmission of information on the Internet is inherently insecure, and we cannot guarantee the security of data sent on the Internet.
You are responsible for keeping the password used to access our website confidential; we will not ask you for your password (except when you log in to the website.
I. Amendment
We may update this policy from time to time by publishing a new version on our website. You should check this page from time to time to ensure that you are aware of any changes to this policy. We may notify you of changes to this policy by email or through the private messaging system on our website.
J. Your rights
You can ask us to provide you with any personal information we hold about you; providing such information should meet the following conditions:
Fees to pay bills;
Provide valid identification documents (we usually accept a copy of the passport certified by a notary public and the original utility bill showing the current address).
To the extent permitted by law, we may retain the personal information you request.
You can ask us not to use your personal information for marketing at any time.
In actual situations, you will usually expressly agree in advance that we use your personal information for marketing purposes, or we will provide you with the option to cancel the use of personal information for marketing purposes.
K. Third-party websites
Our website contains hyperlinks and detailed information to third-party websites. We have no control over the privacy policies and rules of third parties and are not responsible for them.
L. Update information
If the personal information we hold about you needs to be corrected or updated, please let us know.
M. Cookies
Our website uses cookies. A cookie is a file containing an identifier (a string of letters and numbers), which is sent by a web server to a web browser and stored by the browser. Each time the browser requests a page from the server, the identifier is sent back to the server. Cookies may be “permanent” cookies or “session” cookies: permanent cookies will be stored by the web browser and will remain valid during the expiration date set by them, unless the user deletes them before the expiration date. For session cookies, when the web browser is closed, the session cookie will expire at the end of the user’s session. Cookies usually do not contain any information that can identify a user, but the personal information we store about you may be linked to information stored in or obtained from cookies.
The names and purposes of the cookies we use on the website are as follows:
When the user is in these situations: including when visiting the website / tracking the user while browsing the website / using the shopping cart on the website / improving the usability of the website / analyzing the use of the website / managing the website / preventing fraud and improving the security of the website , We will use Google Analytics and AdWords on our website to identify computers;
Most browsers allow you to reject or accept cookies, for example:
In Internet Explorer (version 10), you can block cookies through cookie settings by clicking “Tools” -> “Internet Options” -> “Privacy”, and then clicking “Advanced”;
In Firefox (version 24), you can click “Tools” -> “Options” -> “Privacy”, select “Customize settings history” from the drop-down menu, and then uncheck “Accept cookies from site”. Block all cookies;
In the Chrome browser (version 29), you can access the “Customization and Control” menu, then click “Settings”, “Show advanced settings” and “Content settings”, and then select “Block” under the “Cookies” tab The website sets any data “to block all cookies”.
Blocking all cookies will have a negative impact on the usability of many websites. If you block cookies, you will not be able to use all the features on our website.
You can delete cookies that have been stored on your computer, for example:
In Internet Explorer (version 10), you must manually delete the cookie file (the operating instructions can be found at http://support.microsoft.com/kb/278835);
In Firefox (version 24), you can delete cookies in the following ways: click “Tools” -> “Options” and “Privacy”, then select “Customize settings history”, click “Show Cookies”, and then click “Delete All Cookies”;
In the Chrome browser (version 29), you can delete all cookies by visiting the “Customize and Control” menu, then click “Settings” -> “Show advanced settings” and “Clear browsing data”, then select “Delete cookies and other sites” and plug-in data”, and then click “Clear browsing data”.
Deleting cookies will have a negative impact on the usability of many websites.
function humanFileSize(bytes, dp = 2) {
const thresh = 1024;
if (Math.abs(bytes) < thresh) {
return bytes + 'B';
}
const units = ['KB', 'MB', 'GB'];
let u = -1;
const r = 10 ** dp;
do {
bytes /= thresh;
++u;
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
return bytes.toFixed(dp) + units[u];
}
报错:You already have a current Developer ID Application certificate or a pending certificate request.
Developer ID只能创建5个,新建超过5个时就会出现以上报错,而且开发者账号网站上Developer ID也不能revoke,如果revoke了Developer ID,之前用此证书签名的APP就无法再安装了。
Developer ID证书创建之后一定要注意备份,是可以重用的。
原文链接,此文在原文基础上有补充。
此文章基于Catalina新版发布规则撰写。
你有两种选择来发布适用于MacOS的Electron App。一种是直接发布(请参阅对Electron App进行公证),或通过Mac App Store(MAS)发布。通过MAS分发的所有应用程序都必须进行沙盒处理(sandbox),这意味着除已批准的权利(entitlements)外,它们完全独立。Mac的Catalina OS于2019年10月发布,添加了许多影响沙盒应用程序的更改,导致许多现有的Electron应用程序崩溃并拒绝了新应用程序。 要使基本应用程序成功提交以供审核并批准在Mac App Store上分发,您需要执行以下步骤。
必须使用Electron版本8.0.2或更高版本(或修补版本6.1.7和5.0.13),因为早期版本使用Apple不再允许的私有API。 Electron应该是dev(或global)依赖,而不是production依赖。
npm install -D electron
必须要有苹果开发者账号,需要付费600多一年。在developer.apple.com注册。
每个证书创建需要两步。
3rd Party Mac Developer
)CertificateSigningRequest.certSigningRequest
CertificateSigningRequest.certSigningRequest
) > continue > Download > 双击下载的文件(mac_app.cer
),会自动加载到钥匙串。Mac App Distribution
,加载到钥匙串之后显示的名称是3rd Party Mac Developer Application: {name} (XXXXXXXXXX)
,它们是相同的证书。CertificateSigningRequest.certSigningRequest
文件。大致重复3.1中的流程
3rd Party Mac Developer
)CertificateSigningRequest.certSigningRequest
CertificateSigningRequest.certSigningRequest
) > continue > Download > 双击下载的文件(mac_installer.cer
),会自动加载到钥匙串。Mac Installer Distribution
,加载到钥匙串之后显示的名称是3rd Party Mac Developer Installer: {name} (XXXXXXXXXX)
,它们是相同的证书。CertificateSigningRequest.certSigningRequest
文件。3rd Party Mac Developer Application: {name} (XXXXXXXXXX)
。个人开发者的name就是你的名字。注意:如果更换了开发用的Mac电脑,需要备份证书再导入新设备才可以使用本次生成的证书,否则只能重新生成,之前导入到苹果开发者网站的证书下载导入钥匙串之后会显示缺少私钥,而且网站上可保留的证书数量很有限,想添加多的,只能先revoke以前的。备份的证书需要选择p12格式,包含公钥和私钥,可以设置密码保护。把备份的证书妥善保管,以备更换设备或者切换设备使用。备份操作在证书列表右键,选择导出,按操作提示执行即可。
引用:https://help.apple.com/app-store-connect/
官方文档: help.apple.com/app-store-connect/#/dev2cd126805
此部分稍后再写,也有很多注意事项。
参考:
https://www.electron.build/icons
https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/app-icon
此部分稍后再写
斜体字的值需要更改为你的信息。
{ "name": "AppName", "version": "1.0.0", ... "author": "AuthorName", "build": { "appId": "com.companyname.appname", "productName": "App Name with spaces & special characters", "buildVersion": "1", "copyright": "Copyright © 2020 Developer/Company Name", "mac": { "category": "public.app-category.categoryName", "icon": "build/icon.icns", "target": "mas", "hardenedRuntime": false, "entitlements": "build/entitlements.mas.plist", "entitlementsInherit": "build/entitlements.mas.inherit.plist", "provisioningProfile": "MacAppStore.provisionprofile", } } }
参考文档:
一些注意事项:
name
和productName
:name
将用作您应用在用户计算机上的显示名称。它不能包含空格或特殊字符。如果要在name
中使用空格或特殊字符,请在build
键中添加一个productName
键。 您可以设置其名称,使其显示在Mac App Store的appstoreconnect.apple.com上。version
和buildVersion
:package.json中的version
应与appstoreconnect.apple.com上的应用程序的版本号相对应。如果您将应用程序上传到appstoreconnect,但在决定将其提交审核之前进行更改,则无法删除上传的内容。此时需要设置不同的buildVersion
,重新构建之后上传。 appId
:使用之前在开发者账号网站中创建的App IDcategory
键应与您在appstoreconnect.apple.com中为App设置的category
一致。List of possible categoriestarget
需要设置为mas
hardenedRuntime
需要设置为false
。如果要将app分发到MAS之外,则可以将其设置为true。参考:developer.apple.com/documentation/security/hardened_runtime_entitlements