xcode 被测试的 iPhone 应用程序几天后崩溃

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38307356/
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-09-15 09:01:51  来源:igfitidea点击:

iPhone app under test crashes after a few days

iosobjective-ciphonexcodecrash

提问by hs7624

I am new to making iPhone apps and this is my first attempt.

我是制作 iPhone 应用程序的新手,这是我的第一次尝试。

I have made a simple app which has two buttons in it. One button opens a URL and the other opens a Pop-up window.

我制作了一个简单的应用程序,其中有两个按钮。一个按钮打开一个 URL,另一个按钮打开一个弹出窗口。

I am yet to enroll as an apple developer and am testing my application on the physical device by connecting it to Xcode.

我还没有注册成为 Apple 开发人员,并且正在通过将它连接到 Xcode 在物理设备上测试我的应用程序。

When I install the application, it runs properly for a few days in spite of disconnecting it from Xcode. However, after a few days, the application does not open and flashes a black blank screen and goes back to the home screen.

当我安装该应用程序时,尽管它与 Xcode 断开连接,但它仍能正常运行几天。但是,几天后,该应用程序无法打开并闪烁黑色空白屏幕并返回主屏幕。

When I reconnect it to Xcode and run the same code again on the same iPhone, it works properly again for a few days and then crashes again.

当我将它重新连接到 Xcode 并在同一部 iPhone 上再次运行相同的代码时,它再次正常工作了几天,然后再次崩溃。

I am unable to understand why the app is behaving in such a manner after a few days and not immediately.

我无法理解为什么该应用程序在几天后而不是立即以这种方式运行。

Is there some expiry period for application when one has not signed in as a developer? (The provisioning profile shows expiring soon) If not, can you please guide me as to how to go about troubleshooting this issue?

没有以开发者身份登录的申请是否有有效期?(配置文件显示即将到期)如果没有,请指导我如何解决此问题?

Kindly give me your esteemed suggestions/comments as I am badly stuck and need to find a solution as soon as possible.

请给我您尊敬的建议/意见,因为我被严重卡住了,需要尽快找到解决方案。

Thanks a lot!

非常感谢!

回答by Ketan P

If application is installed with Xcode and you don't have a Paid Program Developer Account, the life expectancy of the app is approximately48 hours (There is no official time of validity for this).

如果应用程序是使用 Xcode 安装的并且您没有付费程序开发者帐户,则该应用程序的预期寿命约为48 小时(对此没有官方的有效时间)

For a paid program, it's a few months with the correct certificate. With TestFlight, it's now 60 days.

对于付费程序,使用正确的证书需要几个月的时间。使用 TestFlight,现在是 60 天。

Indeed, if you don't sign your app, it has low life expectancy. It's quite new that Apple allows installation to devices for free accounts, but it's just for testing purposes (other than simulator), if you want more days to test on a device, you have to pay for the developer program.

事实上,如果你不签署你的应用程序,它的预期寿命就会很短。Apple 允许免费帐户安装到设备是很新的,但这只是为了测试目的(模拟器除外),如果您想在设备上进行更多天的测试,则必须支付开发人员计划

回答by dev_m

No it's not a guess actually...

不,这实际上不是猜测......

It's 7 days exactly for a free developer account.

免费的开发者帐户正好是 7 天。

You can check validity also in Xcode Provisioning profile also:

您也可以在 Xcode Provisioning 配置文件中检查有效性:

In General → Signing ("Automatically Manage Signing" checked) → Provisioning Profile (Click on Info (i) icon) you can check validity of the profile:

一般 → 签名(选中“自动管理签名”)→ 配置文件(单击信息 (i) 图标)您可以检查配置文件的有效性:

screenshot following the above instructions

按照上述说明进行截图

回答by Shane McCurdy

This forum helped me find an answer for a very similar issue I was facing with an Ionic iOS app I have running on a few iPads for a checkin kiosk at a non-profit I am developing for. For my scenario I just need the apps to run locally on WiFi and never on any other devices, never to be downloaded as a distributed app to the public. My apps kept randomly crashing on launch, and I would re-install the app from Xcode and they would start working again.

这个论坛帮助我找到了一个非常相似的问题的答案,我在几个 iPad 上运行了一个 Ionic iOS 应用程序,用于我正在开发的非营利组织的登记亭。对于我的场景,我只需要应用程序在 WiFi 上本地运行,而不要在任何其他设备上运行,也不要作为分布式应用程序下载给公众。我的应用程序在启动时一直随机崩溃,我会从 Xcode 重新安装应用程序,它们会重新开始工作。

So my only real solution was creating an "Ad-Hoc" certificate and provisioning profile, where you can add up to 100 iOS devices to the provision. I had to manually add my 3 iPads to the provisioning profile, then download the file and open it, then in Xcode un-check "Automatically manage signing", then go below to "Provisioning Profile", then select your new ad-hoc style profile. And you shouldbe good as long as your Apple developer account is in good standing (I believe, someone correct me if I'm wrong).

所以我唯一真正的解决方案是创建一个“Ad-Hoc”证书和配置文件,您可以在其中添加多达 100 个 iOS 设备到配置中。我必须手动将我的 3 个 iPad 添加到配置文件,然后下载文件并打开它,然后在 Xcode 中取消选中“自动管理签名”,然后转到“配置文件”,然后选择新的临时样式个人资料。只要您的 Apple 开发者帐户信誉良好,您就应该很好(我相信,如果我错了,有人会纠正我)。

Just a heads up, first you personally have to be a paid and registered developer with Apple, not just added to a team by invite. I was invited in by another team for a completely different project and was not able to get set up and create the certificate and provisioning file on my own because of that. I had to leave my team, then register anew with Apple as an individual developer, then I could complete my steps.

提醒一下,首先您个人必须是 Apple 的付费和注册开发人员,而不仅仅是通过邀请加入团队。我被另一个团队邀请参与一个完全不同的项目,因此无法自行设置和创建证书和配置文件。我不得不离开我的团队,然后以个人开发者的身份在 Apple 重新注册,然后我才能完成我的步骤。

  1. Your Apple developer account
  2. Create a Production Ad-Hoc Distribution Certificate
  3. Create an Ad-Hoc Provisioning Profile
  4. Managing Devises and Provisioning Profiles
  1. 您的 Apple 开发者帐户
  2. 创建生产临时分发证书
  3. 创建 Ad-Hoc 配置文件
  4. 管理设备和供应配置文件