ios 使用 Xcode 4 的 iPhone 临时构建

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5295890/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 19:13:10  来源:igfitidea点击:

iPhone ad hoc build using Xcode 4

iosxcode4adhoc

提问by eMich

I just switched to Xcode 4 and need to make an ad hoc build so my customer can test my app. Yet every tutorial I find is based on Xcode 3 and I can't seem to find my way with Xcode 4 on similar settings and actions I need to do. Is there a tutorial or anything out there that can help me on this? I googled it but with very poor results.

我刚刚切换到 Xcode 4,需要进行临时构建,以便我的客户可以测试我的应用程序。然而,我找到的每个教程都基于 Xcode 3,我似乎无法在 Xcode 4 上找到我需要做的类似设置和操作的方法。有没有教程或任何可以帮助我解决这个问题的东西?我用谷歌搜索,但结果很差。

回答by rckoenes

Make sure you have selected a device from the drop down menu and not the simulator.

确保您从下拉菜单中选择了一个设备,而不是模拟器。

Then in XCode 4 go to product -> archive.

然后在 XCode 4 中转到product -> archive.

After the build is complete open the organizer and selected Archives.

构建完成后打开管理器并选择Archives

Here you will find your build, from here you can then select share, next XCode will ask with which profile to sign the app.

在这里你会找到你的构建,从这里你可以选择共享,接下来 XCode 会询问使用哪个配置文件来签署应用程序。

Now you have created an IPA which you can send to your testers.

现在您已经创建了一个 IPA,您可以将其发送给您的测试人员。

回答by user1527225

I also couldn't find current (August 2013) information on this, particularly for distributing the app to iPhone users with PCs, not Macs. Sorting through the Google results, I found a lot of redundant and confusing information about iTunes Connect and Validation.

我也找不到关于此的当前(2013 年 8 月)信息,特别是将应用程序分发给使用 PC 而不是 Mac 的 iPhone 用户。整理了谷歌的结果,发现了很多关于iTunes Connect and Validation的冗余和混乱的信息。

Here's what worked for me:

以下是对我有用的内容:

  1. You don't need to create an app record in iTunes Connect - that's just for when you want to put it in the store. If that's what you want, look at this: developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/YourFirstAppStoreSubmission/CreateYourAppRecordiniTunesConnect/CreateYourAppRecordiniTunesConnect.html

  2. You don't need to Validate your app. That's just for when you want to put it in the store. If that's what you want, look at this: developer.apple.com/library/ios/recipes/xcode_help-archives_organizer/articles/validating_apps.html

  3. You do need an Ad-Hoc provisioning profile. To get one, follow the instructions under the heading: "Creating Ad Hoc Provisioning Profiles" at: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html. Make sure you double click on the 'name.mobileprovision' file after you download it, to add it to Xcode.

  4. Don't waste time looking in your Xcode Project/Build Settings for an Ad-Hoc Code Signing Entitlement. It doesn't appear in my copy of Xcode, and I didn't need it.

  5. Even though the Ad-Hoc Code Signing Entitlement doesn't appear in the Project/Build Settings, you can see it in the Organizer/Devices/Library/Provisioning Profiles. It will have the name you gave it in step 3.

  6. Now you are ready to build a version of your app for Ad-Hoc distribution:

  7. In Xcode, make sure you are in your project window, with your project selected, and according to the accepted answer above, the iOS Device selected as the build target in the field at the top left adjacent to the Run/Stop buttons.

  1. 您无需在 iTunes Connect 中创建应用程序记录 - 这只是在您想将其放入商店时使用。如果这就是你想要的,看看这个:developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/YourFirstAppStoreSubmission/CreateYourAppRecordiniTunesConnect/CreateYourAppRecordiniTunesConnect.html

  2. 您不需要验证您的应用程序。这只是当你想把它放在商店里的时候。如果这就是你想要的,看看这个:developer.apple.com/library/ios/recipes/xcode_help-archives_organizer/articles/validating_apps.html

  3. 您确实需要一个 Ad-Hoc 配置文件。要获得一个,请按照标题下的说明进行操作:“创建 Ad Hoc 配置文件”:https: //developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html。确保在下载后双击“name.mobileprovision”文件,将其添加到 Xcode。

  4. 不要浪费时间在您的 Xcode 项目/构建设置中查找 Ad-Hoc 代码签名权利。它没有出现在我的 Xcode 副本中,我也不需要它。

  5. 即使 Ad-Hoc 代码签名权利没有出现在项目/构建设置中,您也可以在管理器/设备/库/供应配置文件中看到它。它将具有您在步骤 3 中为其指定的名称。

  6. 现在您已准备好为 Ad-Hoc 分发构建应用程序版本:

  7. 在 Xcode 中,确保您在您的项目窗口中,并选择您的项目,并根据上面接受的答案,在左上角运行/停止按钮旁边的字段中选择 iOS 设备作为构建目标。

7a. From the Xcode Menu Bar, select Product/Build for.../ Archiving (if the "Build For..." options are greyed out, you may be in some window other than the project window, for example the Organizer window).

7a. 从 Xcode 菜单栏中,选择 Product/Build for.../Archiving(如果“Build For...”选项变灰,则您可能在项目窗口以外的某个窗口中,例如管理器窗口)。

7b. From the Xcode menu bar, select Product/Archive

7b. 从 Xcode 菜单栏中,选择 Product/Archive

7c. Open the Organizer window (Shift-Cmd-2), select the Archives icon at the top in the middle.

7c。打开管理器窗口 (Shift-Cmd-2),选择中间顶部的档案图标。

7d. Highlight the version you want to distribute, and click on the "Distribute" button over on the right.

7天。突出显示您要分发的版本,然后单击右侧的“分发”按钮。

7e. Select the "Save for Enterprise or Ad-Hoc deployment" option.

7e。选择“Save for Enterprise or Ad-Hoc deployment”选项。

7f. A "Choose an identity to sign with" dialog appears. From the dropdown list, select the iOS Distribution one you created in step 3. For me, the line with the name I created in Step 3 was greyed out, but the one directly below it worked.

7楼 将出现“选择要签名的身份”对话框。从下拉列表中,选择您在第 3 步中创建的 iOS 发行版。对我来说,我在第 3 步中创建的名称所在的行是灰色的,但它正下方的那个行。

7g. A dialog appears allowing you to name and save your Ad-Hoc app as an .ipa file.

7克。将出现一个对话框,允许您命名 Ad-Hoc 应用程序并将其保存为 .ipa 文件。

8 On your Windows PC:

8 在您的 Windows PC 上:

8a. Copy the YourApp.ipa file and the name.mobileprovision file to somewhere like the desktop.

8a. 将 YourApp.ipa 文件和 name.mobileprovision 文件复制到桌面等位置。

8b. In iTunes, find the main menu (maybe a little icon in the top left of the task bar), and select "Add File to Library... Ctrl+O"

8b. 在 iTunes 中,找到主菜单(可能是任务栏左上角的一个小图标),然后选择“将文件添加到库... Ctrl+O”

8c. Add both the files to the library.

8c。将这两个文件添加到库中。

8d. Plug the iPhone in to the Windows PC

8天。将 iPhone 插入 Windows PC

8e. Go to the iPhone section of iTunes, then to the Apps tab. With any luck you'll see YourApp, and you can click on Install.

8e. 转到 iTunes 的 iPhone 部分,然后转到应用程序选项卡。运气好的话,您会看到 YourApp,然后您可以单击“安装”。