App Distribution Guide--(三)---Configuring Your Xcode Project for Distribution

Configuring Your Xcode Project for Distribution

You can edit your project settings anytime, but some settings are necessary during development. Others are recommended when you distribute your app for beta testing and required when you submit your app to the App Store or Mac App Store.html

你能夠在任什麼時候候編輯項目設置,除了一些在開發期間必要的設置。 其它設置建議你能夠在發佈應用作beta測試以及當你把應用程序提交到應用商店或Mac 應用商店要求時設置。ios

During development, your app must be provisioned and code signed to use certain app services and run on an iOS device (iPad, iPhone, or iPod touch). If you assign a bundle ID and team to your project, Xcode can create the necessary certificates, identifiers, and profiles for you in Member Center. You can enter this information now using the project editor or as needed when you add app services and launch your app.api

在開發期間,你的應用程序必須是已經配置並且是通過代碼簽名以後才能使用特定的應用程序服務,才能在一個iOS設備(好比iPad, iPhone, 或iPod touch)上運行。當你給應用程序設置了一個bundle ID 和 team後,Xcode就在Member Center裏爲應用程序建立必要的cerfificates(證書), identifiers(識別碼)以及profiles(配置文件)。你能夠如今用項目編輯器(project editor)輸入這些信息,也能夠在你運行應用服務以及加載應用程序請求時添加。xcode

Before you distribute your app for testing or to the store, provide all the required information about your app. For example, set app icons to pass iTunes Connect validation tests.session

當你發佈應用程序進行測試或到應用商店以前,提供應用程序所須要的全部信息。好比設置應用程序圖標經過iTunes Connect的驗證測試。架構

Before you upload your app to the store, verify your build settings and set the copyright key for Mac apps.app

上傳應用程序到應用商店以前,驗證你的構建設置,併爲Mac應用程序設置版權(copyright)。dom

Setting Properties When Creating Your Xcode Project

1、建立Xcode項目時設置各類特性編輯器

An assistant guides you through the process of creating an Xcode project. First, you select a template for your project. Starting with the right template helps speed the development process. The assistant also prompts you to enter information about your app that’s used to determine your app’s capabilities and distribute it to customers. If you don’t have this information when you create the project, you can set these properties later. If you are a member of the iOS Developer Program or Mac Developer Program, some of the data in the Xcode project is similar to the data you enter in iTunes Connect, but only the bundle ID needs to match the bundle ID you enter in iTunes Connect before you can upload your app to the store.ide

一個助手將引導您完成建立Xcode項目的進程。首先,爲你的項目建立選擇一個模板。選擇一個正確地模板能夠加快開發進程。 助手還提示你輸入應用程序的信息,這些信息將決定你的應用程序能幹什麼並把它發佈給用戶。若是你在建立項目時沒有設置這些信息,你能夠在之後設置。若是你是iOS 開發者計劃 或 Mac 開發者計劃中的一員,一些你在Xcode項目中輸入的數據跟你在iTunes Connect中數據會很類似,可是隻有項目的bundle ID 跟iTunes Connect中輸入的bundle ID保持一致,才能讓你成功把應用程序上傳到應用商店。

Note: If you don’t have an Xcode project, read the tutorial in Start Developing iOS Apps Today or Start Developing Mac Apps Today to learn how to create one. You can’t perform the tasks in this book without first creating an Xcode project that builds and runs an app.

注意:若是你尚未一個Xcode 項目,閱讀Start Developing iOS Apps Today教程或閱讀Start Developing Mac Apps Today 教程,學習如何建立Xcode項目。 若是你不首先建立一個Xcode項目並構建運行一個應用程序,你沒法執行本書中的任何任務。

 

For iOS apps, a dialog similar to this appears when you create an Xcode project from a template:

當你建立iOS項目時,你會發現選擇了一個模板後會出現跟下圖類似的對話框:  

../Art/3_xcodeassistant_2x.png

The product name is the name of your app as it will appear to customers in the store and should be similar to the app name you enter later in iTunes Connect. Most importantly, a customer should instantly associate the app name and icon in the App Store with the product name and app icon that installs on their devices. The product name is also the name that will appear in Springboard when the app is installed. The product name can’t be longer than 255 bytes and can be no fewer than 2 characters. (Read Best Practices in iTunes Connect Developer Guide for guidelines on choosing an app name.)

product name 是應用程序的名稱,它將顯示在應用商店讓用戶看到。該名字跟你之後在iTunes Connect中要輸入的應用名稱應該相似。 最重要的是,當用戶下載了該應用後看到產品名稱(product name)和應用圖標(app icon)能當即跟應用商店裏的應用名稱和圖標關聯上。當應用程序被下載後,該產品名稱還會被顯示在Springboard上。產品名稱不能超過255字節,也不能少於2個字節。(參見  iTunes Connect Developer Guide 中 Best Practices 裏 關於如何選擇一個應用名稱的指南。)

The organization name is an attribute of the Xcode project and is used in boilerplate text throughout your project folder. For example, the organization name is used in the source and header file copyright strings. The organization name in your Xcode project isn’t the same as the company name that you enter later in iTunes Connect.

organizetion name 是Xcode 項目的一個屬性,它被用於整個項目文件夾的樣板文本(boilerplate text)中。 好比,組織名稱(organization name)被用於資源文件和頭文件的版權字符串中。 Xcode 項目中組織名稱(organization name)跟你之後在iTunes Connect中輸入的公司名稱(company name)不同。

The product name and company identifier you enter are concatenated to create the default bundle ID using reverse domain name service (reverse DNS) notation. The bundle ID needs to be unique to your app, so it’s important to set the company identifier to a unique string as well.

你輸入的產品名稱(product name)和公司識別符(company identifier)用反向域名服務符號(反向DNS)串聯起來用於建立默認的bundle ID。應用程序中的bundle ID必須是惟一的,因此設置一個惟一的公司識別符(company identifier)也很重要。

For iOS apps, you can choose the types of devices you support from the Devices pop-up menu. For Mac apps, you can choose the Mac App Store categories from a pop-up menu.

對於iOS應用程序,你能夠從Devices 彈出菜單選擇你所要支持的設備類型。 Mac應用程序則能夠從一個彈出菜單選擇Mac應用商店類別。

The other values used by the Xcode template are sufficient for building and running your app locally, but later you’ll need to finalize properties, such as the bundle ID. Also, the assistant doesn’t set all required properties for the store. You complete the basic store configuration before you submit. Ideally, you’ll complete this configuration before you distribute your app for testing too.

Xcode模板提供的其它值用來構建和運行本地應用程序已經足夠,可是之後你將須要完成特性的設置,好比bundle ID. 並且助手沒有爲商店設置全部須要的特性。你須要在提交以前完成基本的商店配置。理想狀況下,你將在發佈應用程序進行測試以前完成該配置。

After your app is released, you can’t change some of this metadata, so it’s important to choose your settings carefully. To learn which app states cause some properties to be locked in iTunes Connect, refer to iTunes Connect App Properties in iTunes Connect Developer Guide.

當你的應用程序被髮布(release)了以後, 一些元數據就沒法改變,所以仔細選擇你的設置很重要。要了解哪些應用程序狀態形成iTunes Connect 中的一些特性被鎖定,請參閱 iTunes Connect Developer Guide 中的  iTunes Connect App Properties

Before You Begin Configuring Your Project

2、開始配置你的項目以前

All of the options discussed in this chapter are located in the General pane in the project editor for your target. To open the project navigator, choose View > Navigators > Show Project Navigator. Choose the target from the Project/Targets pop-up menu or in the Targets section of the second sidebar if it appears. Click General to view settings discussed in this chapter.

本章討論的全部選項都在你的target的項目編輯器(project editor)的General面板中。要想開啓項目導航(project navigator),選擇View > Navigators > Show Project Navigator. 從Project 或Targets彈出菜單中選擇target, 或者若是出現第二邊欄(second sidebar),能夠在它上面的Targets區選擇target。點擊General查看本章中討論的設置(settings)。

The screenshot below shows the General pane for an iOS app.

下圖顯示了一個iOS應用程序的General面板快照。

../Art/3_project_navigator_2x.png

Configuring Identity and Team Settings

3、配置標識和團隊設置

For Xcode to create the team provisioning profile, the app’s bundle ID needs to be unique and the project assigned to a team. Later, you provide other information that identifies this version of your app. The identity settings appear in the Identity section of the target’s General pane. For iOS apps, the Identity section appears as shown here:

對於Xcode,要想建立團隊配置文件(team provisioning profile), 首先應用程序的bundle ID必須得惟一,並把項目分配爲一個team。而後,提供其餘信息來識別應用程序的版本。 在target的General面板中的Identity區設置identity settings。下圖爲iOS應用程序的Identity區快照:

../Art/3_ios_app_target_pane_2x.png

About Bundle IDs

一、關於Bundle IDs

bundle ID precisely identifies a single app. A bundle ID is used during the development process to provision devices and by the operating system when the app is distributed to customers. For example, Game Center and In-App Purchase use a bundle ID to identify your app when using these app services. The preferences system uses this string to identify the app for which a given preference applies. Similarly, Launch Services uses the bundle ID to locate an app capable of opening a particular file, using the first app it finds with the given identifier. The bundle ID is also used to validate an app’s signature.

bundle ID 能夠明確地識別一個應用程序。bundle ID 在開發過程當中提供給設備以及當應用程序發佈給用戶後提供給操做系統使用。好比,當使用Game Center 和 內置購買(In-App Purchase) 時,它們將使用bundle ID來識別你的應用程序。相似地,啓動服務用bundle ID來讓應用程序可以打開一個特殊文件,該應用程序就是使用給定的標識符(identifier)可以找到的第一個應用程序。bundle ID還能夠驗證一個應用程序的簽名。

The bundle ID string must be a uniform type identifier (UTI) that contains only alphanumeric characters (A-Z,a-z,0-9), hyphen (-), and period (.). The string should be in reverse-DNS format. For example, if your company’s domain is Acme.com and you create an app named Hello, you could assign the string com.Acme.Helloas your app’s bundle ID.

bundle ID字符串必須是一個同一類型標識符(UTI),它只包括字母數字字符(A-Z, a-z,0-9),連字符(-),以及點(.). 字符串應該是反向域名服務格式。好比,若是你的公司的域名爲Acme.com,而且你建立一個已經名叫Hello的應用,你的bundle ID就是com.Acme.Hello.

During the development process, you use an app’s bundle ID in many different places to identify the app.

在開發期間,你須要在不少不一樣的地方使用應用bundle ID來識別應用程序。

../Art/BundleID.png

Specifically, the bundle ID is located and used as follows:

具體來講,bundle ID能夠在如下地方使用:

    • In the Xcode project, the bundle ID is stored in the information property list file (Info.plist). This file is later copied into your app’s bundle when you build the project.

在Xcode項目中,bundle ID被存儲在Info.plist文件中。 當你構建(build)該項目時,該文件會被拷貝進應用程序的bundle裏。

    • In Member Center, you create an App ID that matches the app’s bundle ID. If the App ID is an explicit App ID, it exactly matches the bundle ID. However, unlike domain names, bundle IDs are case sensitive. If the App ID is lowercase, your bundle ID needs to be lowercase, too.

在Member Center中,你建立一個App ID跟應用bundle ID相匹配. 若是App ID 是一個explicit App ID, 它能跟bundle ID徹底匹配。然而,不像域名,bundle ID 都是區分大小寫的。 若是App ID是小寫的,那麼你的bundle ID也須要小寫。

    • In iCloud, the container IDs you specify in your Xcode project are based on the bundle IDs of one or more apps.

在iCloud中,你在Xcode項目中指定的容器ID都是基於一個或多個應用程序的bundle ID的。

    • In iTunes Connect, you enter the bundle ID to identify your app. After your first version is available on the store, you can’t change your bundle ID or delete the associated explicit App ID.

在iTunes Connect中,你輸入bundle ID來識別你的應用程序。 當你的應用程序在應用商店上線了以後,你不能再更改你的bundle ID,也不能刪除相關的 Explicit App ID。

Note: A Mac app and an iOS app can’t share the same bundle ID.

注意:一個Mac 應用程序和一個iOS應用程序之間不能共享一個bundle ID.

 

Setting the Bundle ID

2. 設置Bundle ID

The default bundle ID in your Xcode project is a string formatted as a reverse-domain—for example, com.MyCompany.MyProductName. To create the default bundle ID, Xcode concatenates the company identifier with the product name you entered when creating the project from a template, as described in Setting Properties When Creating Your Xcode Project. (Xcode replaces spaces in the product name to create the default bundle ID.) It may be sufficient to replace the company identifier prefix in the bundle ID, or you can replace the entire bundle ID. For example, change the company identifier prefix to match your company domain name, or replace the entire bundle ID to match an explicit App ID.

Xcode項目中的默認bundle ID是一個反域名格式的字符串---好比,com.myCompany.MyProductName. 當你從一個模板建立一個項目時,Xcode會把公司標識符和你輸入的產品名稱串聯起來建立一個默認的bundle ID,正如在 Setting Properties When Creating Your Xcode Project 中所述。 (Xcode 把產品名稱中的空格替換掉後建立默認的bundle ID) 你能夠修改bundle ID中的公司標識符前綴,或者你能夠把整個bundle ID都改爲跟Explicit App ID相匹配的bundle ID.

For Mac apps, ensure that every bundle ID is unique within your app bundle. For example, if your app bundle includes a helper app, make sure that its bundle ID is different from your app’s bundle ID.

對於Mac應用程序,確保你的應用bundle中的每一個bundle ID都是惟一的。好比,若是你的應用bundle中包含了一個helper 應用程序,請確保它的bundle ID跟你的應用程序的bundle ID不同。

Follow these steps to change the bundle ID prefix in the General pane in the project editor.

跟着如下步驟來修改項目編輯器(project editor)的General面板中的bundle ID的前綴。

To set the bundle ID prefix

要想設置bundle ID前綴:

  1. In the project navigator, select the project and your target to display the project editor.

    在項目導航區, 選擇project 以及你的target,顯示項目編輯器(project editor)。

  2. Click General and, if necessary, click the disclosure triangle next to Identity to reveal the settings.

    點擊General, 若是須要,點擊Identity邊上的展開三角把設置展開。

    ../Art/3_ios_app_target_pane_2x.png
  3. Enter the bundle ID prefix in the Bundle Identifier field.

    在Bundle Identifier區輸入bundle ID前綴。

Alternatively, follow these steps to change the entire bundle ID in the Info pane in the project editor.

另外,跟隨如下步驟更改項目編輯器重Info面板中的整個bundle ID。

To set the bundle ID

設置bundle ID

  1. In the project navigator, select the project and your target to display the project editor.

    在項目導航,選擇項目和你的target, 顯示項目編輯器。

  2. Click Info.

    點擊Info。

  3. Enter the bundle ID in the Value column of the 「Bundle identifier」 row.

    在「Bundle identifier"行輸入bundle ID的值。

    ../Art/3_ios_info_bundle_id_2x.png

Choosing a Signing Identity (Mac Only)

3. 選擇一個簽名標識符(僅Mac)

You have the choice of submitting your Mac app to the store, signing it with a Developer ID certificate to distribute it outside of the store, or not code signing it at all. If you select Mac App Store, you assign your Xcode project to a team and can enable app services, as described in Adding Capabilities. If you select Developer ID, you assign your Xcode project to a team but can’t use any app services in your application (read Distributing Applications Outside the Mac App Store for how to create a Developer ID-signed application). If you select None, the Team pop-up menu is disabled and you don’t need to read this guide.

 

 

To select a signing identity

 

  1. In the project navigator, select the project and your target to display the project editor.

     

  2. Click General and, if necessary, click the disclosure triangle next to Identity to reveal the settings.

     

  3. Select the type of signing identity you want to use.

     

    • If you want to submit your app to the store, select Mac App Store.

       

    • If you want to distribute your Mac application outside of the store and not use app services, select Developer ID.

       

    • If you don’t want to sign your application or use app services, select None.

       

    ../Art/3_selectdistributionmethod_2x.png

Assigning the Xcode Project to a Team

4. 給Xcode項目設置一個團隊

Each Xcode project is associated with a single team. If you enroll as an individual, you’re considered a one-person team. The team account is used to store the certificates, identifiers, and profiles needed to provision your app. All iOS apps and some Mac apps need to be code signed and provisioned to run on a device and use certain app services. Xcode creates these assets for you when needed, but you can avoid warnings and dialogs later if you set the team now.

每一個Xcode項目都跟一個單獨的團隊有關。 若是你是我的開發,則你被認爲是一個一人團隊。 團隊帳號用來存儲各類證書(certificates),標識符(identifiers)以及應用程序的各類配置文件(provision profiles)。全部的iOS應用程序和一些Mac應用程序都須要簽名和配置後才能在設備上運行和使用一些特定的應用服務。 Xcode在須要的時候爲你建立這些assets,可是若是你如今設置了團隊你就能夠避開各類警告和對話框。

To assign the project to a team

爲項目設置一個團隊:

  1. In the project navigator, select the project and your target to display the project editor.

    在項目導航,選擇項目和你的target,顯示項目編輯器。

  2. Click General and, if necessary, click the disclosure triangle next to Identity to reveal the settings.

    點擊General ,若是須要點擊Identity邊上的展開三角展開各類設置。

  3. Choose your team from the Team pop-up menu.

    從Team彈出菜單選擇你的團隊。

    • If you’re an individual, choose your name from the pop-up menu.

      若是你是我的開發,從彈出菜單選擇你的名字。

    • If you’re a company, choose your company name from the pop-up menu.

      若是你是一個公司,從彈出菜單選擇你的公司名稱。

    ../Art/3_assignteam_ios_2x.png

    Xcode may attempt to create a team provisioning profile. For iOS apps, Xcode creates a team provisioning profile if you have an iOS device connected or have previously registered an iOS device. To resolve issues related to the team provisioning profile, read Creating the Team Provisioning Profile.

    Xcode或許會嘗試着建立一個團隊配置文件(provisioning profile)。對於iOS應用程序,Xcode建立一個團隊配置文件,若是你鏈接了一個iOS設備或者之前註冊過一個iOS設備。想要解決團隊配置文件相關的問題,請看Creating the Team Provisioning Profile.

  4. If a team doesn’t appear in the Team pop-up menu, choose 「Add an Account」 and follow the steps described in Adding Your Apple ID Account in Xcode.

    若是在Team彈出菜單中沒有出現團隊,選擇」Add an Account"並根據 Adding Your Apple ID Account in Xcode中描述的步驟。

 

Creating the Team Provisioning Profile

五、建立團隊配置文件

After you select a team, Xcode attempts to create your code signing identity and a development provisioning profile. Xcode creates a specialized development provisioning profile called a team provisioning profile that it manages for you. A team provisioning profile allows an app to be signed and run by all team members on all their devices. If Xcode fails to create the team provisioning profile, a warning and Fix Issue button appear below the Team pop-up menu.

當你選擇了一個團隊後,Xcode嘗試建立你的代碼簽名標識,以及一個開發配置文件。 Xcode建立一個專門的開發配置文件,叫作team provisioning profile。團隊配置文件容許全部的團隊成員對應用程序進行簽名並在他們所有的設備中運行。若是Xcode建立團隊配置文件識別,會再Team彈出菜單的下面顯示一個warning和一個Fix Issue按鈕。

 

../Art/3_tb_noprovisioningprofile_2x.png

 

To create the team provisioning profile, Xcode performs these steps:

建立團隊配置文件,Xcode執行如下步驟:

  1. Requests your development certificate

    請求你的開發者證書。

  2. Registers the iOS device chosen in the Scheme toolbar menu or your Mac

    註冊在Scheme toolbar menu(計劃工具欄菜單)或你的Mac中註冊的iOS設備。

  3. Creates an App ID that matches your app’s bundle ID and enables app services

    建立一個跟應用程序bundle ID相匹配的App ID,並開啓應用服務。

  4. Creates a team provisioning profile containing these assets

    建立一個包含這些assets的團隊配置文件(team provisioning profile)

  5. Sets your project’s code signing build settings accordingly

    設置你的項目的代碼簽名構建相應的設置。

Important: If you are a team member for a company account, ask your team agent or admin to register your Mac on your behalf, as described in Registering Team Member Devices. Also, ask the team agent or admin to follow these steps to create the team provisioning profile if it doesn’t already exist. To download the team provisioning profile to your Mac, refresh the provisioning profiles, as described in Refreshing Provisioning Profiles in Xcode, or click the Fix Issue button under the Team pop-up menu.

 重要提示:若是你事一個公司帳號的團隊成員,請求你的團隊代理人或管理者註冊以你的名義註冊你的Mac,請看 Registering Team Member Devices中所述。同時若是在member center 中沒有團隊配置文件,也請他照着如下步驟建立一個。 而後把團隊配置文件下載到你的Mac電腦,照着 Refreshing Provisioning Profiles in Xcode 中的方法刷新配置文件,或者點擊Team彈出菜單下面的Fix Issue方法。

You can assist Xcode and avoid common problems by creating the team provisioning profile now.

你能夠如今就建立團隊配置文件幫助Xcode並避免常見問題。

To create a team provisioning profile

建立一個團隊配置文件:

  1. In the project navigator, select the project and your target to display the project editor.

    在項目導航,選擇project 和 你的target, 顯示項目編輯器(project editor)。

  2. Click General and, if necessary, click the disclosure triangle next to Identity to reveal the settings.

    點擊General,而且若有須要,點擊Identity邊上的展開三角來展開各類設置。

  3. Verify that your bundle ID is unique by using a unique prefix.

    用一個惟一的前綴來驗證你的bundle ID是惟一的。

    Depending on your project’s configuration, Xcode may create either a wildcard App ID or an explicit App ID. Because Xcode uses the bundle ID to register an explicit App ID, the bundle ID also needs to be unique during development. To avoid an App ID registration error, enter a unique bundle ID now, as described in Setting the Bundle ID.

    根據你的項目配置,Xcode可能建立一個通配符(wildcard)App ID 或者是一個 explicit(明確) App ID.  由於Xcode使用bundle ID 來註冊一個explicit App ID, 因此在開發過程當中bundle ID也須要是惟一的。 爲了不產生一個App ID 註冊錯誤,如今就輸入一個惟一的bundle ID,請看Setting the Bundle ID中所述。

  4. For iOS apps, connect an iOS device you want to use for development and choose the device from the Scheme toolbar menu.

    對於iOS應用程序,鏈接開發須要使用的iOS設備,並從計劃工具欄菜單(Scheme toolbar menu)選擇設備。

    Xcode requires one or more registered devices in your account before it can create a team provisioning profile. (For Mac apps, Xcode automatically registers the Mac that’s running Xcode.) If you connect an iOS device to your Mac that matches the deployment target, Xcode registers the device for you. If the iOS device isn’t eligible because it doesn’t match the deployment target, upgrade the iOS on the device or change the deployment target, as described in Setting Deployment Info.

     在你的帳戶中,Xcode會在建立一個團隊配置文件前請求一個或多個註冊設備。 (對於Mac 應用程序, Xcode 自動註冊運行Xcode的Mac。) 若是你鏈接了一個匹配系統目標的iOS設備,Xcode就爲你註冊該設備。若是iOS設備不符合條件,那時由於它不匹配系統目標,升級設備的iOS或者調整系統目標,請看 Setting Deployment Info描述。

  5. If necessary, choose your team from the Team pop-up menu.

    若是有必要,從Team彈出菜單中選擇團隊。 

    For Mac apps, Mac App Store must be selected as the type of signing identity before you can choose a team.

     對於Mac應用程序,Mac應用商店必須先選擇簽名標識的類型,而後才能選擇團隊。

  6. If a Fix Issue button appears below the Team pop-up menu, click it.

     若是在Team彈出菜單下面出現了一個Fix Issue按鈕,點擊它。

    ../Art/3_tb_noprovisioningprofile_2x.png

    Xcode starts performing all the steps needed to create a team provisioning profile for your app. If no warning message appears below the Team pop-up menu, Xcode already created your team provisioning profile.

     Xcodek爲你的應用程序開始執行建立一個團隊配置文件的全部步驟。 若是在Team彈出菜單下面沒有出現warning信息,那就是說Xcode已經建立好團隊配置文件。

  7. If dialogs or warnings appear, use the information to correct the problem and click Fix Issue again.

     若是出現對話框或警告,使用出現的信息來更正問題並在此點擊Fix Issue。

    After Xcode creates the team provisioning profile, the warning message under the Team pop-up menu disappears.

     當Xcode建立完團隊配置文件後,Team彈出菜單下面的警告消息就會消失。

    ../Art/3_tb_team_profile_created_2x.png

 

Setting the Application Category (Mac Only)

6. 設置應用程序類別(僅Mac)

Set the category under which your Mac app will be listed on the Mac App Store. The category you select should match the category you later select in your iTunes Connect app record.

 

To set the application category

 

  1. In the project navigator, select the project and your target to display the project editor.

     

  2. Click General and, if necessary, click the disclosure triangle next to Identity to reveal the settings.

     

  3. Choose the category from the Application Category pop-up menu.

     

    ../Art/3_selectdistributionmethod_2x.png

iOS app categories are set in iTunes Connect only. For more details on app categories, read Best Practices in iTunes Connect Developer Guide.

Setting the Version Number and Build String

七、設置版本號和Build字符串

The version number is a two-period-separated list of positive integers, as in 4.5.2. The first integer represents a major revision, the second a minor revision, and the third a maintenance release. The version number is shown in the store and that version should match the version number you enter later in iTunes Connect. For details on possible values, see CFBundleShortVersionString in Information Property List Key Reference.

版本號是由兩個點分隔的正整數,好比4.5.2。 第一個整數表示一個主要版本號,第二個整數是次要版本號,第三個數字是維護版本。版本號在應用商店中顯示,版本號應該跟iTunes Connect中的版本號一致。更多可能值的詳情,請參見 Information Property List Key Reference 中的CFBundleShortVersionString

The build string represents an iteration (released or unreleased) of the bundle and is also a two-period-separated list of positive integers, as in 1.2.3. For Mac apps, the user can click the version number in the About window to toggle between the version number and the build string. For details on possible values, seeCFBundleVersion in Information Property List Key Reference.

build字符串(buile string)表示一個bundle迭代(發佈或未發佈), 它也是由兩個點分隔的正整數造成,好比1.2.3。對於Mac 應用程序,用戶能夠在About窗口裏點擊版本號來切換版本號和build字符串(build string)。 更多可能值詳情,請看

 Information Property List Key Reference CFBundleVersion

For iOS apps, update the build string whenever you distribute a new build of your app for testing. iTunes will recognize that the build string changed and properly sync the new iOS app to the device. For how to configure your app for testing, read Beta Testing iOS Apps.

對於iOS應用程序,每次你發佈應用程序的一個新版本進行測試時均可以更新build string。iTunes會識別出更新後的build 字符串並正確地把新的iOS應用同步到設備。 關於如何配置測試你的應用程序,請看Beta Testing iOS Apps.

Set the version number and build string in the General pane in the project editor.

能夠在項目編輯器(project editor)的General面板查看版本號和build 字符串.

To set the version number and build string

設置版本號和build字符串

  1. In the project navigator, select the project and your target to display the project editor.

    在項目導航,選擇項目和你的target,顯示項目編輯器(project editor). 

  2. Click General and, if necessary, click the disclosure triangle next to Identity to reveal the settings.

     點擊General,若是須要,點擊Identity邊上的展開三角來展開各類設置。

  3. Enter the version number in the Version field, and enter the build string in the Build field.

    在Version字段輸入版本號,在Build字段輸入build字符串。 

    ../Art/3_tb_team_profile_created_2x.png

Setting Deployment Info

4、設置系統信息

The default deployment settings are sufficient for development, but it’s best to review these settings before you distribute your app. Some settings must match values you enter in iTunes Connect later. For iOS apps, the deployment settings appear as shown here:

默認的系統設置對於開發已經足夠,不過最好仍是在發佈應用程序以前在檢查一下這些設置。 一些設置必須跟你稍後在iTunes Connect中輸入的內容相一致。 如下是iOS應用程序系統設置:

../Art/3_deployment_info_2x.png

Setting the Deployment Target

一、設置系統目標

The deployment target setting specifies the lowest operating system version that your app can run on. For example, the lowest available setting for iPad apps is iOS 4.3.

系統目標設置指明瞭應用程序能夠運行的最低操做系統版本。 好比,iPad應用程序最低可能的設置是iOS 4.3。

There are several strategies for choosing the deployment target when developing your app. Each version of iOS or OS X includes features and capabilities not present in earlier versions. As new versions are published, some users may upgrade immediately, while other users may wait before moving to the latest version. You can target the latest version, taking full advantage of all the new features but limiting the app to only users running the latest version. Or you can target an earlier version, making your app available to more users but limiting the features you can use in the app. Another approach is to target an earlier version but use weak linking to determine at runtime whether later version features are available before using them.

當你開發應用程序時,如何選擇系統目標有幾種方法。 每種iOS或OS X的版本都包含了一些之前的版本沒有的特性和功能。 當新版本發佈時,有些用戶可能當即進行更新,然而其它客戶可能會一直不更新到最新版本。 你能夠選擇適配最新的iOS版本,徹底使用全部最新的功能,可是用戶羣就只能固定在使用最新版本的用戶。或者你能夠選擇一個早期版本,讓你的應用程序能夠有更多的用戶羣,可是你的應用程序卻只能使用限制的功能。另外一個方法是使用一個早期的版本但在使用前用弱連接來肯定運行時最近版本的功能是否能用。

For details on weak linking, read Weak Linking and Apple Frameworks in SDK Compatibility Guide.

關於弱鏈接的詳情,請看SDK Compatibility Guide 中的 Weak Linking and Apple Frameworks

To set the target version

如何設置目標版本

  1. In the project navigator, select the project and your target to display the project editor.

     在項目導航,選擇項目和你的target來顯示項目編輯器(project editor)。

  2. Click General and, if necessary, click the disclosure triangle next to Deployment Info to reveal the settings.

     點擊General,若是須要點擊Deloyment Info展開各類設置。

  3. Choose the version you want to target from the Deployment Target pop-up menu.

     從Deployment Target的彈出菜單中選擇你想要的目標版本。

    ../Art/3_deployment_target_2x.png

Xcode sets the Minimum System Version key in the app’s information property list to the deployment target you choose. When you publish your app to the store, it uses this property value to indicate which versions your app supports.

Xcode在應用程序Info.plist中的Minimum System Version中顯示了你選擇的最低系統版本。當你發佈應用到商店時,它用該特性值來指示你的應用程序支持哪些版本。

Note: The SDK version, not the deployment target, determines which features you can use in an app. If the SDK you’re using to build the app is more recent than the app’s deployment target, Xcode displays build warnings when it detects that your app is using a feature that’s unavailable in the deployment target.

注意:是SDK版本,而不是系統目標,決定你的應用程序但是使用功能。若是你用來構建應用程序的SDK版本比應用程序的deloyment target版本更高,當Xcode檢測到你的應用程序使用了不符合你的deployment target的功能時,它會顯示構建警告。

Ensure that the symbols you use are available in the app’s runtime environment. To check for their availability, use the techniques described in SDK Compatibility Guide.

確保你使用的符號(symbols)在應用程序的運行環境中都是可用的。檢查它們是否可用,使用SDK Compatibility Guide中描述的技術。

 

Setting the Target Devices (iOS Only)

設置目標設備(僅iOS)

The Devices setting identifies the type of devices you want an iOS app to run on. There are two device types: iPhone and iPad. The iPhone type includes iPhone and iPod touch devices. The iPad type includes all iPad and iPad mini devices.

Devices 設置定義了一個iOS應用程序運行的設備類型。 目前有兩種設備類型:iPhone 和 iPad。 iPhone類型包括了iPhone 和 iPod touch 設備。 iPad類型包括了全部iPad 和 iPad mini設備。

To set the target devices

設置目標設備:

  1. In the project navigator, select the project and your target to display the project editor.

     在項目導航,選擇項目和你的target,顯示項目編輯器(project editor)。

  2. Click General and, if necessary, click the disclosure triangle next to Deployment Info to reveal the settings.

     點擊General,若是須要點擊Deployment Info邊上的展開三角來展開各類設置。

  3. From the Devices pop-up menu, choose iPhone, iPad, or Universal (to target both families).

     從Devices彈出菜單,選擇iPhone,iPad或者 Universal(兩種類型都選擇)。

    ../Art/3_target_devices_setting_2x.png

For more information on configuring your app for iPhone, iPad, or both device families, see Advanced App Tricks in App Programming Guide for iOS.

更多關於爲應用程序配置iPhone , iPad, 或者兩種設備都選的信息,請看App Programming Guide for iOS中的 Advanced App Tricks 。

Adding App Icons and a Launch Screen File

5、添加應用圖標和一個啓動文件

App icons and the launch screen file are stored in the app bundle, not uploaded as separate assets to iTunes Connect. The operating system uses these images and the launch screen file (a .xib file) in various locations on a device to represent your app. In general, artwork displayed by the operating system resides in the bundle, and artwork displayed by iTunes is uploaded to iTunes Connect. Your app needs an app icon to represent it and pass validation tests.

應用圖標和啓動文件存儲在應用程序的bundle中,不是單獨做爲assets上傳到iTunes Connect。 操做系統在設備的不一樣地方都使用這些圖片和啓動文件(一個.xib文件),它們能夠用來表示你的應用程序。 通常狀況下,操做系統須要顯示的圖片(artwork)存在bundle中,而iTunes須要顯示的artwork則被上傳到iTunes Connect。 你須要一個應用圖標來表示它並經過認證測試。

You use an asset catalog that manages the app icons for you or maintain individual image files yourself. If you create a new project, asset catalogs are used by default to store app icons and a launch screen file is used as a splash screen. For iOS 7 deployment targets, you can supply both a launch screen file and launch images. In iOS 8, the launch screen file is used, and in iOS 7, the launch images are used. If you have an older project, you can migrate from managing individual icon image files to an asset catalog. You can also add a launch screen file to an older Xcode project.

你可使用一個asset catalog來管理你的全部應用圖標,或者仍是保留獨立的圖片文件。若是你建立了一個新的項目,項目默認使用asset catalogs 來存儲應用圖標,一個啓動文件做爲初始畫面。對於iOS 7 系統目標, 你能夠同時提供一個啓動文件和啓動圖片。 在iOS 8中,使用啓動文件,在iOS 7中,使用啓動圖片。若是你有一個老的項目,你能夠把獨立的圖標文件移動到一個asset catalog中。 你還能夠給老Xcode項目添加一個啓動文件。

If you prefer to manage your assets as individual image files, read Setting Individual App Icon and Launch Image Files. If you want to migrate to an asset catalog, read Migrating Your Images to an Asset Catalog. To learn more about creating and managing asset catalogs, read Asset Catalog Help.

若是你更喜歡管理獨立的圖片文件,請看 Setting Individual App Icon and Launch Image Files. 若是你想把圖片加入一個asset catalog, 請看 Migrating Your Images to an Asset Catalog.

Preparing Your Artwork

一、準備你的Artwork

For all artwork, keep the file size as small as possible for a positive purchase experience for your users.

爲了給用戶提供一個積極的購買體驗,讓全部的artwork文件大小盡量的小。

For iOS apps, see Icon and Image Sizes in iOS Human Interface Guidelines for the sizes of all required app icons, launch images, and other icons.

對於iOS應用程序,參見 iOS Human Interface Guidelines 中的Icon and Image Sizes ,查看全部須要的應用圖標,啓動圖片以及其它圖標的尺寸。

In iOS 7, a launch image matching the device resolution appears as soon as the user taps your app icon. Use screenshots to create your app’s launch images. To take advantage of Retina displays, provide high-resolution images for each device you support. For guidance on creating launch images, read Launch Images.

在iOS 7中,當用戶點擊了你的應用圖標後,一張匹配設備分辨率的啓動出現就會出如今屏幕上。 使用屏幕快照來建立應用程序的啓動圖片。 爲了體現Retina顯示屏的優點,對每一個你所支持的設備提供高分辨率圖片。關於建立啓動圖片的指導,請看 Launch Images

For the required Mac app icons, see Creating Great Icons for Any Resolution in OS X Human Interface Guidelines. This table includes icon sizes that may be used on the Mac App Store. To create your app icon files, read Provide High-Resolution Versions of All App Graphics Resources in High Resolution Guidelines for OS X.

對於須要的Mac 應用圖標,查看Creating Great Icons for Any Resolution in OS X Human Interface Guidelines. 這個表格包含了可能用於Mac 應用商店的圖標尺寸。 要想爲你的應用程序建立圖標文件,請看High Resolution Guidelines for OS X 中的 Provide High-Resolution Versions of All App Graphics Resources。

For the specification of screenshots and other artwork that you upload later using iTunes Connect, read iTunes Connect App Properties in iTunes Connect Developer Guide.

關於你之後須要上傳到iTunes Connect的屏幕快照和其它artwork的規則,請看 iTunes Connect Developer Guide中的 iTunes Connect App Properties 。

Adding App Icons to an Asset Catalog

二、把應用圖標加入Asset Catalog

Versions of your app icons are organized into image sets in an asset catalog. Xcode automatically creates image sets for the app’s target device—for example, both iPhone and iPad image sets appear if your iOS app’s target is universal.

你的應用程序的全部圖標都被放進一個asset catalog中的圖片集中。 Xcode會爲應用程序的目標設備自動建立圖片集---好比,若是iOS應用目標是iPhone 和 iPad都支持,則Xcode自動爲iPhone 和iPad都建立圖片集。

To add an app icon to an asset catalog

把一張應用圖標加入一個asset catalog

  1. In the project navigator, select the project and your target to display the project editor.

     在項目導航,選擇項目和你的target, 顯示項目編輯器(project editor)。

  2. In the 「App Icons and Launch Images」 section of the General pane, click the arrow button to the right of the App Icons Source pop-up menu.

     在General面板的「App Icons and Launch Images」中,點擊位於App Icons Souce彈出菜單右邊的小箭頭。

    ../Art/3_app_icon_arrow_2x.png
  3. In the Finder, drag an app icon to the image well that matches its resolution in the project navigator.

     在Finder中,把應用圖標拖入項目導航的圖片井中,拖入的圖標要符合它的分辨率。

    ../Art/3_add_app_icon_to_asset_catalog_2x.png

Creating a Launch Screen File

3. 建立一個啓動文件

The launch screen file is displayed as a splash screen while your app is launching. It’s a single, atomic .xib file that uses size classes to support different device resolutions. It contains basic UIKit views, such as UIImageView and UILabel objects, and uses Auto Layout constraints. Xcode adds a default launch screen file, called LaunchScreen.xib, to your project.

當你的應用程序啓動時,啓動文件是第一個屏幕。 它是一個單一的,原子.xib文件,它使用各類尺寸類來支持不一樣的設備分辨率。 它包含了基礎UIKit視圖,好比UIImageView和UILabel對象等,而且還使用了自動佈局常量。 Xcode默認爲你的項目添加了一個名叫LaunchScreen.xib的啓動文件。

Follow these guidelines when creating a launch screen file:

當你建立一個啓動文件時,請跟隨如下步驟:

  • Use only UIKit classes.

     只用UIKit類。

  • Use a single root view that is a UIView or UIViewController object.

     使用一個單獨的根視圖,一個UIView或UIViewController對象。

  • Don’t make any connections to your code (don’t add actions or outlets).

     不要跟你的代碼有任何鏈接(不要添加任何的動做或接口)。

  • Don’t add UIWebView objects.

     不要添加UIWebView對象。

  • Don’t use any custom classes.

     不要使用任何的自定義類。

  • Don’t use runtime attributes.

     不要使用運行時屬性。

You can add a launch screen file to an older Xcode project.

你能夠給老項目添加一個啓動文件。

To create a launch screen file for an existing project

給一個已經存在的項目建立一個啓動文件。

  1. Choose File > New > File.

     選擇File > New >File.

  2. Under iOS, select User Interface.

     在iOS下,選擇Uset Interface。

  3. Click Launch Screen and click Next.

     點擊Launch Screen 並點擊Next。

    ../Art/3_create_launch_screen_file_2x.png
  4. Enter a filename in the Save As text field, and click Create.

     輸入文件名,並點擊Create.

To set the launch screen file

 設置啓動文件:

  1. If necessary, open the 「App Icons and Launch Images」 section of the General pane.

     若是須要,打開General 面板的App Icons and Launch Images.

  2. From the Launch Screen File pop-up menu, choose a launch screen file.

     從Launch Screen File 彈出菜單中,選擇一個啓動文件。

Adding Launch Images and Capturing Screenshots

4. 添加啓動圖片和捕捉屏幕快照。

For iOS 7 deployment targets, add an asset catalog for launch images, described in Migrating Your Images to an Asset Catalog. Capture screenshots to create the launch images and add them to the asset catalog, similar to adding app icons to an asset catalog, described in Adding App Icons to an Asset Catalog.

對於iOS 7 系統目標,爲啓動圖片添加一個asset catalog, 請看Migrating Your Images to an Asset Catalog. 捕捉屏幕快照來建立啓動圖片並把它們加入asset catalog. 添加應用圖標到asset catalog,跟添加啓動圖片很類似,請看 Adding App Icons to an Asset Catalog.

Follow these steps to capture a screenshot of your iOS app while your device is connected to your Mac. Although the screenshot includes the status bar as it looks when the screenshot is captured, iOS replaces it with the current status bar when your app launches.

當設備鏈接到Mac時,能夠跟隨如下這些步驟來步驟一張屏幕快照。 儘管捕捉的屏幕快照帶有狀態欄,可是iOS會在應用程序啓動時用當前的狀態欄替換它。

To capture a screenshot on your iOS app

爲iOS應用程序截屏:

  1. Connect the iOS device to your Mac.

    把iOS設備鏈接到Mac。 

  2. Choose Window > Devices, and select the device under Devices.

     選擇Window > Devices ,並選擇Devices下面的設備。

  3. In the Device Information section, click Take Screenshot.

     在Device Information section,點擊Take Screenshot。

    ../Art/3_take_screenshot_2x.png

    The screenshot appears on your desktop.

Setting Individual App Icon and Launch Image Files

5. 設置單獨的應用圖標和啓動圖片文件

If you don’t want to use an asset catalog, choose 「Don’t use asset catalogs」 from either the App Icons Source or Launch Images Source pop-up menu in the 「App Icons and Launch Images」 section of the General pane. If a Use Asset Catalog button appears, you are not using an asset catalog.

若是你不想用一個asset catalog, 從App Icons Source 或 Launch Images Source彈出菜單選擇「Don't use asset catalogs", 它們位於General面板的」App Icons and Launch Images「區。 若是出現了」Use Asset Catalog「字樣,就說明你已經沒有使用asset catalog.

Migrating Your Images to an Asset Catalog

6. 把你的圖片移入一個asset catalog

If you have an older project, you can migrate your image files to an asset catalog that manages your app icons and launch images for you. Xcode moves the image files from the tables to the new asset catalog. You create a separate asset catalog for app icons and launch images, but the steps are identical.

若是你有一個老項目,你能夠把圖片文件移入一個asset catalog, 它能爲你管理應用圖標和啓動圖片。 Xcode把圖片從表格(tables)移入新的asset catalog. 你須要單獨爲應用圖標和啓動圖片撞見一個asset catalog, 它們的建立步驟是同樣的。

To migrate to an asset catalog

把圖片移入一個asset catalog

  1. In the project navigator, select the project and your target to display the project editor.

    在項目導航,選擇項目和你的target ,顯示項目編輯器(project editor)。 

  2. Click General and, if necessary, click the disclosure triangle next to 「App Icons and Launch Images.」

     點擊General,若是須要點擊」App Icons and Launch Images「邊上的展開三角。

  3. Click the Use Asset Catalog button next to either App Icons Source or Launch Images Source.

     點擊App Icons Source 或 Launch Images Source邊上的Use Asset Catalog 按鈕。

    ../Art/3_use_asset_catalog_2x.png
  4. In the dialog that appears, choose either Images or New Asset Catalog from the pop-up menu, and click Migrate.

     在出現的對話框中,選擇Images 或者 New Asset Catalog,而後點擊Migrate

    ../Art/3_migrate_to_catalog_2x.png

To view the asset catalog, click the arrow button to the right of the App Icons Source or Launch Images Source pop-up menu.

要想查看asset catalog, 點擊 App Icons Source 或 Launch Images Source彈出菜單邊上的箭頭按鈕。

Setting the Copyright Key (Mac Only)

七、設置版權鍵(僅Mac)

Make sure that your information property list file contains a valid value for the Copyright key. For details on possible values, see NSHumanReadableCopyright inInformation Property List Key Reference.

To edit the copyright key in the information property list

  1. In Xcode, select the project in the project navigator.

     

  2. Click the disclosure triangle next to the ProjectName folder to reveal its contents.

     

  3. Click the disclosure triangle next to the Supporting Files subfolder to reveal its contents.

     

  4. Select the ProjectName-Info.plist file.

     

    The information property list is displayed to the right in a property list editor.

     

    ../Art/3_copyright_key_2x.png
  5. Double-click in the Value column and in the row of the Copyright key.

     

  6. Enter a new value for the key.

     

For how to edit other cells in a property list, refer to Property List Editor Help.

Verifying Your Build Settings

6、驗證你的Build Setting

If you changed the default build settings, verify some of the settings before submitting your app to the store. You do this in the Build Settings pane of the project editor.

若是你更改了默認的Build Setting,在把應用程序提交到商店以前驗證一些設置。 你能夠在項目編輯器的Build Setting面板完成這個。

To edit a build setting

如何編輯一個build setting

  1. In the project editor, select the project or target whose build setting you want to edit.

     在項目編輯器,選擇項目或target來編輯build setting。

  2. At the top of the project editor, click Build Settings.

     在項目編輯器的頂部,點擊Build Setting。

    ../Art/3_edit_build_settings_2x.png
  3. Locate the build setting in the left column, or enter the name of the build setting in the search field in the upper-right corner.

    從左列找到你要編輯的build setting,或者在右上角的搜索字段輸入構建設置的名稱。 

  4. If some build settings don’t appear, click All.

     若是一些build setting 沒有出現,點擊All。

  5. Set the value for the build setting in the right column.

     在右列設置build setting的值

Setting Architectures for iOS Apps

1. 爲iOS應用程序設置Architectures

The Architectures build setting identifies the architectures for which your app is built. An iOS device uses a set of architectures, which include armv7 and arm64. You have two options for specifying the value of this setting:

Architectures 構建設置標識了應用程序構建哪一個架構。 一個iOS設備使用了一系列的架構,包括armv7 和 arm64等. 該設置有兩個選項。

  • Standard. Produces an app binary with a common architecture, compatible with all supported iOS devices. This option generates the smallest app, but it may not be optimized to run at the best possible speed for all devices.

     標準架構。  產生一個通用架構的二進制應用程序,它能適配全部支持的iOS設備。 該選項生成最小的應用程序, 可是它可能不能優化到能在全部的設備商都以最大可能的速度運行。

  • Other. Produces an app binary for a specified set of architectures.

     其它架構。產生一個指定架構集的二進制應用程序。

If you select Other from the Architectures build-setting value list, click the Add button (+) to enter the custom iOS-device architecture names you support.

你在此選擇了Other選項,點擊(+)來輸入你所支持的自定義iOS設備架構名稱。

Important: The store rejects a binary that supports only armv7s. If armv7s is included in the Valid Architectures list, armv7 must also be included.

 重要提示:應用商店不接受只支持armv7s的二進制應用。 若是armv7s被加入了有效的架構列表,那麼armv7也必須被加入。

Setting the Base SDK

2. 設置Base SDK

The Base SDK version number must be greater than or equal to the software version number on your development device; otherwise, Xcode can’t initiate a debugging session with the device. Set the Base SDK for your project and targets to the latest operating system, which is the default value. The Base SDK property is located in the Architectures area in the Build Settings pane. For iOS apps, set Base SDK to Latest iOS. For Mac apps, set Base SDK to Latest OS X. If you select another value, download and install the latest SDK version that’s greater than or equal to your device software version.

Base SDK版本號必須大於或等於你的開發設備上的軟件版本號;不然,Xcode沒法用設備初始化一個調試會話。爲項目設置Base SDK,把它設置爲最新的操做系統,它是默認值。 Base SDK 特性位於Build Setting面板的Architectures 區。 對於iOS應用程序,把Base SDK設置爲最新的iOS操做系統。 對於Mac 應用程序,則把它設爲最新的OS X系統。 若是你設置了另外的值,下載並安裝最新的SDK,它必須大於或等於設備軟件版本號。

To go to the Architectures area, select the project or target and click Build Settings. The Architectures area appears first in the Build Settings pane.

要想進入Architectures 區,選擇項目或者target並點擊Build Settings. Architechtures區首先出如今Build Setting面板。

../Art/3_base_sdk_2x.png

Setting the Debug Information Format

三、設置Debug Information Format

Set the Debug Information Format build setting to 「DWARF with dSYM File.」 This is required to symbolicate crash reports, as described in Analyzing Crash Reports.

把Debug Information Format設置爲「DWARF with dSYM File.」 正如Analyzing Crash Reports中所述,這是必要的symbolicate 崩潰報告。

../Art/3_debug_info_format_2x.png

Recap

總結

In this chapter, you learned how to configure your Xcode project from a template, set the app’s identity information, and create a team provisioning profile for development. During development, refer to this chapter as needed. Later, use this chapter as a checklist for the settings that are required by the App Store and Mac App Store.

在本章,咱們學習了若是從一個模板配置Xcode項目, 設置應用程序的標識信息,併爲開發建立看一個團隊配置文件。 在開發過程當中

相關文章
相關標籤/搜索