使用 Xcode 4 进行 iPhone 特别构建
我刚刚切换到 Xcode 4,需要进行临时构建,以便我的客户可以测试我的应用程序。然而,我找到的每个教程都是基于 Xcode 3 的,而我似乎无法在 Xcode 4 上找到我需要执行的类似设置和操作的方法。有教程或任何东西可以帮助我吗?我用谷歌搜索了它,但结果很差。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保您从下拉菜单中选择了设备而不是模拟器。
然后在 XCode 4 中转到
product ->存档
。构建完成后,打开管理器并选择
Archives
。在这里您将找到您的构建,然后您可以从这里选择共享,接下来 XCode 将询问使用哪个配置文件来签署应用程序。
现在您已经创建了一个 IPA,您可以将其发送给测试人员。
Make sure you have selected a device from the drop down menu and not the simulator.
Then in XCode 4 go to
product -> archive
.After the build is complete open the organizer and selected
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.
Now you have created an IPA which you can send to your testers.
我也找不到这方面的最新(2013 年 8 月)信息,特别是将该应用程序分发给使用 PC(而不是 Mac)的 iPhone 用户的信息。通过对 Google 结果进行排序,我发现了很多关于 iTunes Connect 和 Validation 的冗余且令人困惑的信息。
以下是对我有用的方法:
您无需在 iTunes Connect 中创建应用程序记录 - 这仅适用于您想要将其放入商店的情况。如果这就是您想要的,请查看以下内容: https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/YourFirstAppStoreSubmission/CreateYourAppRecordiniTunesConnect/CreateYourAppRecordiniTunesConnect.html
您无需验证您的应用。这仅适用于您想将其放入商店时。如果这就是您想要的,请查看以下内容:https: //developer.apple.com/library/ios/recipes/xcode_help-archives_organizer/articles/validating_apps.html
您确实需要一个临时配置文件。要获取一个,请按照“创建临时配置文件”标题下的说明进行操作:https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html。下载“name.mobileprovision”文件后,请确保双击该文件,将其添加到 Xcode。
不要浪费时间在 Xcode 项目/构建设置中查找临时代码签名权利。它没有出现在我的 Xcode 副本中,而且我也不需要它。
即使临时代码签名权利没有出现在项目/构建设置中,您也可以在管理器/设备/库/配置文件中看到它。它将具有您在第 3 步中指定的名称。
现在您已准备好构建用于 Ad-Hoc 分发的应用版本:
在 Xcode 中,确保您位于项目窗口中,选择了您的项目,并根据上面接受的答案,选择了 iOS 设备左上角靠近“运行/停止”按钮的字段中的构建目标。
从 Xcode 菜单栏中,选择 Product/Build for.../Archiving(如果“Build For...”选项呈灰色,则您可能位于项目窗口以外的某个窗口中,例如 Organizer 窗口)。
从 Xcode 菜单栏中选择“产品/存档”
打开管理器窗口(Shift-Cmd-2),选择顶部中间的“档案”图标。
突出显示您要分发的版本,然后点击右侧的“分发”按钮。
选择“保存用于企业或临时部署”选项。
出现“选择要签名的身份”对话框。从下拉列表中,选择您在第 3 步中创建的 iOS 发行版。对于我来说,带有我在第 3 步中创建的名称的行显示为灰色,但其正下方的行有效。
出现一个对话框,允许您命名 Ad-Hoc 应用程序并将其另存为 .ipa 文件。
在 Windows 电脑上:
将 YourApp.ipa 文件和 name.mobileprovision 文件复制到桌面等位置。
在 iTunes 中,找到主菜单(任务栏左上角可能有一个小图标),然后选择“将文件添加到资料库... Ctrl+O< /kbd>“
将这两个文件添加到库中。
将 iPhone 插入 Windows PC
转至 iTunes 的 iPhone 部分,然后转至“应用程序”选项卡。如果幸运的话,您将看到 YourApp,然后您可以单击“安装”。
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.
Here's what worked for me:
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: https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/YourFirstAppStoreSubmission/CreateYourAppRecordiniTunesConnect/CreateYourAppRecordiniTunesConnect.html
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: https://developer.apple.com/library/ios/recipes/xcode_help-archives_organizer/articles/validating_apps.html
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.
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.
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.
Now you are ready to build a version of your app for Ad-Hoc distribution:
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.
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).
From the Xcode menu bar, select Product/Archive
Open the Organizer window (Shift-Cmd-2), select the Archives icon at the top in the middle.
Highlight the version you want to distribute, and click on the "Distribute" button over on the right.
Select the "Save for Enterprise or Ad-Hoc deployment" option.
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.
A dialog appears allowing you to name and save your Ad-Hoc app as an .ipa file.
On your Windows PC:
Copy the YourApp.ipa file and the name.mobileprovision file to somewhere like the desktop.
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"
Add both the files to the library.
Plug the iPhone in to the Windows PC
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.