在没有苹果开发者程序或越狱的设备上测试 iOS 应用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4952820/
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
Test iOS app on device without apple developer program or jailbreak
提问by Cyclone
How can I test an iOS application on my iPod Touch without registering for the Apple Developer Program or jailbreaking my iPod?
如何在不注册 Apple Developer Program 或越狱 iPod 的情况下在 iPod Touch 上测试 iOS 应用程序?
Neither is a viable option at the moment.
目前两者都不是可行的选择。
I'd like to test on the device itself instead of the onscreen simulator to see how it performs on an actual iPod.
我想在设备本身而不是屏幕模拟器上进行测试,以了解它在实际 iPod 上的表现。
回答by BoltClock
Seven years after the inception of the App Store (July 10, 2008), Apple has finally introduced a new feature in Xcode 7 that allows you to deploy and run any number of apps on any of your devices, simply by logging in with your Apple ID. You will no longer need a paid Program membership to deploy apps on your own device(and you certainly no longer have to jailbreak your device if you're not comfortable doing so).
在 App Store 成立七年后(2008 年 7 月 10 日),Apple 终于在 Xcode 7 中引入了一项新功能,您只需使用 Apple 登录即可在任何设备上部署和运行任意数量的应用程序ID。您将不再需要付费计划会员资格来在您自己的设备上部署应用程序(如果您不习惯这样做,您当然不再需要越狱您的设备)。
Well, not for the majority of use cases anyway. For obvious reasons, certain capabilities and entitlements that require Program membership such as Game Center and in-app purchases will not be available to apps deployed using this method. From Apple's developer documentation:
好吧,无论如何都不适用于大多数用例。出于显而易见的原因,使用此方法部署的应用程序将无法使用某些需要计划会员资格的功能和权利,例如游戏中心和应用程序内购买。来自Apple 的开发者文档:
Launch Your App on Devices Using Free Provisioning (iOS, watchOS)
If you don't join the Apple Developer Program, you can still build and run your app on your devices using free provisioning. However, the capabilities available to your app, described in Adding Capabilities, are restricted when you don't belong to the Apple Developer Program.
在使用免费配置的设备上启动您的应用程序(iOS、watchOS)
如果您不加入 Apple Developer Program,您仍然可以使用免费配置在您的设备上构建和运行您的应用程序。但是,当您不属于 Apple Developer Program 时,您的应用程序可用的功能(如添加功能中所述)会受到限制。
The precise steps to getting your app onto your iOS device or Apple Watch follow immediately thus (screenshots omitted for ease of skimming):
将您的应用程序安装到您的 iOS 设备或 Apple Watch 上的精确步骤如下(为了便于浏览,省略了屏幕截图):
In Xcode, add your Apple ID to Accounts preferences, described in Adding Your Apple ID Account in Xcode.
In the project navigator, select the project and your target to display the project editor.
Click General and choose your name from the Team pop-up menu.
Connect the device to your Mac and choose your device from the Scheme toolbar menu.
Below the Team pop-up menu, click Fix Issue.
Xcode creates a free provisioning profile for you and the warning text under the Team pop-up menu disappears.
Click the Run button.
Xcode installs the app on the device before launching the app.
在Xcode中,添加你的Apple ID,以账户的喜好,在描述在Xcode中添加您的Apple ID帐户。
在项目导航器中,选择项目和目标以显示项目编辑器。
单击“常规”并从“团队”弹出菜单中选择您的姓名。
将设备连接到 Mac,然后从“方案”工具栏菜单中选择您的设备。
在团队弹出菜单下方,单击修复问题。
Xcode 会为您创建一个免费的配置文件,Team 弹出菜单下的警告文本就会消失。
单击运行按钮。
Xcode 在启动应用程序之前在设备上安装应用程序。
Prior to Xcode 7, a Program membership was indeed required in order to sign the provisioning certificates required to deploy apps to devices. The only other alternative was jailbreaking. With Xcode 7, you no longer need to jailbreak your device just to run apps distributed outside the App Store, or to test apps if you cannot afford to join the Program, or to deploy and use apps that you have developed for your own personal use if you do not intend to distribute them through the App Store (in which case you probably don't need the entitlements offered by Program membership anyway).
在 Xcode 7 之前,确实需要程序成员身份才能签署将应用程序部署到设备所需的配置证书。唯一的其他选择是越狱。使用 Xcode 7,您不再需要越狱您的设备只是为了运行在 App Store 之外分发的应用程序,或者在您负担不起加入该计划的情况下测试应用程序,或者部署和使用您开发的供您个人使用的应用程序如果您不打算通过 App Store 分发它们(在这种情况下,您可能不需要计划会员提供的权利)。
回答by WrightsCS
There's a way you can do this.
有一种方法可以做到这一点。
You will need ROOT access to edit the following file.
您将需要 ROOT 访问权限才能编辑以下文件。
Navigate to
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk
and open the fileSDKSettings.plist
.In that file, expand DefaultPropertiesand change CODE_SIGNING_REQUIREDto
NO
, while you are there, you can also change ENTITLEMENTS_REQUIREDtoNO
also.
导航到
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk
并打开文件SDKSettings.plist
。在该文件中,展开DefaultProperties并将CODE_SIGNING_REQUIRED更改为
NO
,同时您还可以将ENTITLEMENTS_REQUIRED更改为NO
。
You will have to restart Xcode for the changes to take effect. Also, you must do this for every .sdk you want to be able to run on device.
您必须重新启动 Xcode 才能使更改生效。此外,您必须为希望能够在设备上运行的每个 .sdk 执行此操作。
Now, in your project settings, you can change Code Signing Identity
to Don't Code Sign
.
现在,在您的项目设置中,您可以更改Code Signing Identity
为Don't Code Sign
.
Your app should now build and install on your device successfully.
您的应用程序现在应该成功构建并安装在您的设备上。
UPDATE:
更新:
There are some issues with iOS 5.1 SDKthat this method may not work exactly the same. Any other updates will be listed here when they become available.
iOS 5.1 SDK存在一些问题,该方法可能无法完全相同地工作。任何其他更新可用时将在此处列出。
UPDATE:
更新:
You can find the correct path to SDKSettings.plist
with xcrun
.
您可以找到SDKSettings.plist
with的正确路径xcrun
。
xcrun --sdk iphoneos --show-sdk-path
New SDKSettings.plist location for the iOS 5.1 SDK:
iOS 5.1 SDK 的新 SDKSettings.plist 位置:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/SDKSettings.plist
回答by Roberto
With Xcode 7you are no longer required to have a developer account in order to testyour apps on your device:
使用Xcode 7,您不再需要拥有开发者帐户才能在您的设备上测试您的应用程序:
Check it out here.
检查它在这里。
Please notice that this is the officially supported by Apple, so there's no need of jailbroken devicesor testing on the simulator, but you'll have to use Xcode 7 (currently in beta by the time of this post) or later.
请注意,这是 Apple 官方支持的,因此不需要越狱设备或在模拟器上进行测试,但您必须使用 Xcode 7(在本文发布时目前处于测试阶段)或更高版本。
I successfully deployed an app to my iPhone without a developer account. You'll have to use your iCloud accountto solve the provisioning profile issues. Just add your iCloud account and assign it in the Teamdropdown (in the Identitymenu) and the Fix Issuebutton should do the rest.
我在没有开发人员帐户的情况下成功将应用程序部署到我的 iPhone。您必须使用您的iCloud 帐户来解决配置文件问题。只需添加您的 iCloud 帐户并在团队下拉列表(在身份菜单中)中分配它,然后修复问题按钮即可完成剩下的工作。
UPDATE:
更新:
Some people are having problems with iOS 8.4, here is how to fix it.
有些人在使用 iOS 8.4 时遇到问题,这里是解决方法。
回答by Firula
回答by Atul Kaushik
Go to Build Settings, under Code Signing, set Code Signing Identityas iOS Developer& Provisioning Profileas Automatic.
转到Build Settings,在Code Signing 下,将Code Signing Identity设置为iOS Developer& Provisioning Profile为Automatic。
Select your device (now visible) from drop down list and run your app.
从下拉列表中选择您的设备(现在可见)并运行您的应用程序。
回答by MatthewPearson
The JailCoder references above point to a site that does not exist any more. Looks like you should use http://oneiros.altervista.org/jailcoder/or https://www.facebook.com/jailcoder
上面的 JailCoder 引用指向一个不再存在的站点。看起来你应该使用http://oneiros.altervista.org/jailcoder/或https://www.facebook.com/jailcoder
回答by razor7
just tested JailCoder www.jailcoder.comand i'm able to run and debugon jailbroken devices. You just need a fresh untouched install of xCode, if not, just uninstall and install xCode again and run JailCoder
刚刚测试了 JailCoder www.jailcoder.com,我能够在越狱设备上运行和调试。你只需要一个全新的未改动过的 xCode 安装,如果没有,只需卸载并再次安装 xCode 并运行 JailCoder
回答by Rob Vermeulen
It's worth the buck to apply for the Apple developer program. You will be able to use ad-hoc provisioning to distribute your app to testers and test devices. You're allowed to add 100 ad-hoc provisioning devices to your developer program.
申请 Apple 开发者计划是值得的。您将能够使用临时配置将您的应用程序分发给测试人员和测试设备。您可以将 100 个临时配置设备添加到您的开发人员计划中。
回答by Preetha
Follow these Steps:
按着这些次序:
1.Open the Xcode->Select the project->select targets->Tick an automatically manage signing->then add your apple developer account->clean the project->build the project->run,everything works fine.
1.打开Xcode->选择项目->选择目标->勾选自动管理签名->然后添加您的苹果开发者帐户->清理项目->构建项目->运行,一切正常。