yaofly2012 / note

Personal blog

Home Page:https://github.com/yaofly2012/note/issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IOS 开发

yaofly2012 opened this issue · comments

commented

术语 & 概念

Team相关

  1. TeamID
  2. Identifiers
  3. ...

App相关

1. Adam ID

App Store Connect叫Apple ID(猜测是为了和开发者账号的Apple ID区分才取别名Adam ID)
image

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由两部分构成:

  1. 前缀(以TeamID作为前缀)
  2. Bundle ID / Bundle ID通配符

根据构成的第二个部分可以对APP ID分成两类:

  1. 显示的(explicit),精确匹配一个APP
  2. 通配符,匹配多个APP

在这里可以配置APP启动的能力和服务。
image

管理标识符

Devices(调试设备列表)

测试设备列表

注册设备

Profiles(预置描述文件)

本质是个配置文件(看文件的icon)。预置描述文件用于授权你的 App 使用某些 app 服务,并确保你是开发、上传或分发你的 App 的已知开发者。
一个App的描述文件里包含了:

  1. 证书(certificates)
  2. App ID
  3. 可用设备(device)
  4. 启动的能力(Enabled Capabilities)

用处:

  • 以便在真机上测试应用程序。
  • 描述文件包含了开发者证书的信息,以及开发者帐号下的设备的列表,这样,当你在 Xcode 中打包并部署你的 iOS 应用时,Xcode 就会使用这个描述文件来验证该应用是否可以在你的设备上运行

知乎 iOS 的「描述文件」是什么?
一看就会的ios配置证书及描述文件

Certificates(证书)

iOS证书的作用是保证应用程序的安全性和可信度,防止恶意软件和病毒的入侵。
形象点描述当我们向Apple申请证书,就是向权力机关(Apple)申请资格(开发/推送/发布...)而Apple颁发给我们的证书就是对资格的证明。

ios证书有什么用
iOS的开发中相关证书的理解及作用原创

Membership details

  1. Entity name:
  2. Team ID:
  3. Program: Apple Developer Program
  4. Enrolled as: Organization ?
  5. Organization

参考

  1. What Are App IDs and Bundle Identifiers
  2. In-house vs ad-hoc distribution
  3. ad-hoc 的全称是什么?
commented

Certificates, IDs & Profiles

Manage the certificates, identifiers, profiles, and devices required to develop, test, and distribute apps.

从开发到部署都需要配置certificates, identifiers, profiles。怎么要这么复杂呢?

保障安全的手段:

  1. 签名(CodeSign)
  2. 沙盒(Sandbox)

iOS代码签名 ?

参考

  1. 深度长文:细说iOS代码签名
  2. 22张图 | ios证书配置流程 | 超详细
commented

Info.plist

An information property list file is a structured text file that contains essential configuration information for a bundled executable.

有两个地方可以查看Info.plist信息:

  1. 项目Info.plist文件;
  2. Xcode的target配置面板的Info tab:
    image

Info.plist文件

Info.plist文件一般在Target根目录里。可以在Build Settings -> Packaging里查看Info.plist文件位置。
image

管理配置

${BUILD_SETTING_KEY}

通过${BUILD_SETTING_KEY}方式可以引用Build Settings的值。

如何知道Build Settings对应的BUILD_SETTING_KEY呢?

  1. Build Settings里鼠标Hover在配置上3s就可以看到提示
image
  1. 参考Build settings reference

常见配置

Bundle version/Bundle version string (short)

What's the difference between "version number" in iTunes Connect, "bundle version", "bundle version string" in Xcode?

  1. Bundle version string (short)就是平时我们常看到的APP版本。
  2. Bundle version

Must be a build number, e.g. a single integer like 435163

发布的时候这两个值要更新。

Bundle name / Bundle display name

What's the difference between "bundle display name" and "bundle name" in cocoa application's info plist

  1. Bundle display name对客展示的名字,比如:
  • CFBundleDisplayName is also what displays as the title of notifications
  • used in the iTunes File Sharing Feature
  1. Bundle name

Bundle OS Type code

The four-letter code identifying the bundle type

标记App/Bundle类型。除了文档里罗列的值APPL/FMWK /BNDL,还看到其他值:XPC!, $(PRODUCT_BUNDLE_PACKAGE_TYPE)

  1. $(PRODUCT_BUNDLE_PACKAGE_TYPE)

InfoDictionary version

Info.plist文件版本,目前是6。
What does "InfoDictionary version" signify in information property list (plist file)?

参考

  1. What is Info.plist in Xcode
  2. Information Property List Key Reference
  3. How to set Info.plist Values based on Build Configuration in Xcode
  4. 移动位置后-无法找到info.plist文件
  5. iOS工程配置info.plist文件总结
  6. Where are ${EXECUTABLE_NAME} and ${PRODUCT_NAME} defined
commented

XXX.entitlements文件

Entitlements

Entitlements confer specific capabilities or security permissions to your iOS or macOS app.

iOS或者macOS被授予的特定的功能和安全权限。

XXX.entitlements文件

  1. XXX.entitlements文件也是个.plist`格式的
  2. 可以在Xcode target -> Build Settings -> Signning管理XXX.entitlements文件文件位置
image

参考

  1. About Entitlements
  2. Xcode entitlement 问题定位和解决指南
  3. 关于iOS XCode的entitlements文件
commented

Xcode

名词和术语

  1. target
  2. project
  3. workspace
  4. App
  5. Scene
  6. rootViewController

参考

  1. Xcode iOS 工程目录结构解析
  2. Xcode工程结构详解
commented