IOS 开发
yaofly2012 opened this issue · comments
术语 & 概念
Team相关
- TeamID
- Identifiers
- ...
App相关
1. Adam ID
在App Store Connect叫Apple ID(猜测是为了和开发者账号的Apple ID区分才取别名Adam ID)
An automatically generated ID assigned to your app.
就是Apple给App自动生成的唯一标识。
主要用于APP Store里唯一标识APP,在APP Store的URL 路径参数里(格式是https://apps.apple.com/app/{AdamID}
),比如https://apps.apple.com/app/681752345
2. Bundle ID
The bundle ID must match the one you used in Xcode. It can't be changed after you upload your first build.
3. App ID
An App ID is a two-part string used to identify one or more apps from a single development team. The string consists of a Team ID (supplied by Apple and unique to a specific development team) and a Bundle ID search string (supplied by developer), with a period (.) separating the two parts.
// Example of Team ID:
1234ABCD
// Example of Bundle ID:
com.issuer.issuerApp
// Example of App ID:
1234ABCD.com.issuer.issuerApp
App ID并不是App的唯一标识,它可以对应多个应用,详情参考What Are App IDs and Bundle Identifiers。
4. appLunchUrl
scheme://path
怎么确定scheme
?
Url Schema是App向OS注册,接收通知的一种协议,当系统捕获该注册的schema时候,会将该schema广播给注册过该schema的App。
IOS Deep linking: URL Scheme vs Universal Links
Identifiers (标识符列表)
即APP ID,但是可以对应多个APP。标识符对应描述文件里的APP ID。
APP ID由两部分构成:
- 前缀(以TeamID作为前缀)
- Bundle ID / Bundle ID通配符
根据构成的第二个部分可以对APP ID分成两类:
- 显示的(explicit),精确匹配一个APP
- 通配符,匹配多个APP
Devices(调试设备列表)
测试设备列表
Profiles(预置描述文件)
本质是个配置文件(看文件的icon)。预置描述文件用于授权你的 App 使用某些 app 服务,并确保你是开发、上传或分发你的 App 的已知开发者。
一个App的描述文件里包含了:
- 证书(certificates)
- App ID
- 可用设备(device)
- 启动的能力(Enabled Capabilities)
用处:
- 以便在真机上测试应用程序。
- 描述文件包含了开发者证书的信息,以及开发者帐号下的设备的列表,这样,当你在 Xcode 中打包并部署你的 iOS 应用时,Xcode 就会使用这个描述文件来验证该应用是否可以在你的设备上运行
知乎 iOS 的「描述文件」是什么?
一看就会的ios配置证书及描述文件
Certificates(证书)
iOS证书的作用是保证应用程序的安全性和可信度,防止恶意软件和病毒的入侵。
形象点描述当我们向Apple申请证书,就是向权力机关(Apple)申请资格(开发/推送/发布...)而Apple颁发给我们的证书就是对资格的证明。
Membership details
- Entity name:
- Team ID:
- Program:
Apple Developer Program
- Enrolled as:
Organization
? - Organization
参考
Certificates, IDs & Profiles
Manage the certificates, identifiers, profiles, and devices required to develop, test, and distribute apps.
从开发到部署都需要配置certificates, identifiers, profiles。怎么要这么复杂呢?
保障安全的手段:
- 签名(CodeSign)
- 沙盒(Sandbox)
iOS代码签名 ?
参考
Info.plist
An information property list file is a structured text file that contains essential configuration information for a bundled executable.
有两个地方可以查看Info.plist信息:
Info.plist文件
Info.plist文件一般在Target根目录里。可以在Build Settings -> Packaging
里查看Info.plist文件位置。
管理配置
${BUILD_SETTING_KEY}
通过${BUILD_SETTING_KEY}
方式可以引用Build Settings
的值。
如何知道Build Settings
对应的BUILD_SETTING_KEY
呢?
- 在
Build Settings
里鼠标Hover在配置上3s就可以看到提示
常见配置
Bundle version
/Bundle version string (short)
Bundle version string (short)
就是平时我们常看到的APP版本。Bundle version
Must be a build number, e.g. a single integer like 435163
发布的时候这两个值要更新。
Bundle name
/ Bundle display name
Bundle display name
对客展示的名字,比如:
- CFBundleDisplayName is also what displays as the title of notifications
- used in the iTunes File Sharing Feature
Bundle name
?
Bundle OS Type code
The four-letter code identifying the bundle type
标记App/Bundle类型。除了文档里罗列的值APPL
/FMWK
/BNDL
,还看到其他值:XPC!
, $(PRODUCT_BUNDLE_PACKAGE_TYPE)
。
$(PRODUCT_BUNDLE_PACKAGE_TYPE)
?
InfoDictionary version
Info.plist
文件版本,目前是6。
What does "InfoDictionary version" signify in information property list (plist file)?
参考
XXX.entitlements
文件
Entitlements
Entitlements confer specific capabilities or security permissions to your iOS or macOS app.
iOS或者macOS被授予的特定的功能和安全权限。
XXX.entitlements
文件
- XXX.entitlements
文件也是个
.plist`格式的 - 可以在Xcode
target
->Build Settings
->Signning
管理XXX.entitlements
文件文件位置