本文介绍了调用API后,iPhone重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面临一个非常奇怪的问题:我的iPhone正在重新启动.此问题仅在特定情况下发生.

I am facing a very weird issue: my iPhone is restarting.This issue occurs in a particular scenario only.

第1步:我有一个同步过程,其中正在为整个应用程序加载数据.因此,我基本上通过上传4-5个相机捕获的图像并同步应用程序数据来进行繁重的API调用;

Step 1: I have a sync process in which I'm loading data for the whole app. So I'm basically doing a heavy API call by uploading 4-5 camera captured images and syncing the app data;

第2步:同步后,我按下iPhone主页按钮使应用程序进入后台;

Step 2: After syncing, I'm pressing the iPhone home button to make the app go in background;

第3步:我正在锁定iPhone屏幕(使用侧面按钮);

Step 3: I'm locking the iPhone screen(by using side button);

几秒钟后,我看到苹果徽标,并且手机似乎重新启动.当应用程序以调试模式连接时,这不会复制.我检查了调试导航器应用程序仅使用125 MB的内存,磁盘和网络值是0%.能量影响显示较高,我不确定这是由于能量影响较高所致.我仅在iOS 12.4上遇到此问题.

After a few seconds I'm seeing the apple logo and the phone seems to restart. This is not replicating when the app is connected in debug mode. I checked the debug navigator app is using only 125 MB of memory, disk and network values is 0%. Energy Impact is showing high, I'm not sure this is due to high energy impact. I'm facing this issue only on iOS 12.4.

推荐答案

电话(或者可能只是跳板)重新启动的事实,不仅仅是您的应用程序重新启动,这意味着这是Apple的错误.即使尝试尝试,也无法使iOS崩溃.

The fact that the phone (or possibly just springboard) restarts, and not just your application means this is Apple's bug. You're not supposed to be able to crash iOS even if you try.

很难找到可能的原因,因为系统没有按照预期的方式运行.设备的日志可能包含除您的应用以外的其他信息.由于您的应用程序执行了许多操作,这可能是系统API中断.

Finding a likely cause will be hard since the system is not behaving the way it's supposed to. The device's logs may have more information from things other than your app. This may be a system API breaking due to any number of actions from your application.

通常使用这种方式,下一个OS版本可以解决该问题,但是如果不是这种情况,或者重要的是进行跟踪,我将尝试删除与系统交互的方式(后台API,通知等).并查看是否可以解决问题.

Often with this kind of thing the next OS version will fix it, but if that's not the case or it's important to track down I would try removing ways you're interaction with the system (background APIs, notifications, etc.) and see if anything fixes the issue.

如果发现问题,甚至可能根据文档以正确"的方式进行操作,并且必须找到解决方法.如果有时间,您可以将错误提交给Apple ,以便更好地解决潜在的问题

If you find the problem, you may even be doing things the "correct" way according to the documentation and have to find a workaround. If you have the time you can submit a bug to Apple so the underlying issue has a better chance of being fixed.

这篇关于调用API后,iPhone重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 08:27