应用程序在iPhone上崩溃但在模拟器上没有崩溃

时间:2021-12-12 23:07:19

I'm using XCode 7.0b5 and created an Swift app. It runs fine on simulator but crashes on iPhone 4s when running independently (without cable). How can identify where it crashes? I read about possible memory issues. I'm reading in a large textfile, so it needs nearly 200 MB of ram. How can I check it?

我正在使用XCode 7.0b5并创建了一个Swift应用程序。它在模拟器上运行良好,但在独立运行时(无线缆)在iPhone 4上崩溃。如何识别崩溃的位置?我读到了可能的内存问题。我正在读大文本文件,所以它需要近200 MB的内存。我怎么检查呢?

2 个解决方案

#1


3  

I think this is a memory problem with the iPhone 4S (200 mb for 4S is a lot). You should read the crash logs in Xcode.

我认为这是iPhone 4S的内存问题(4S的200 mb很多)。您应该阅读Xcode中的崩溃日志。

In Xcode with the iPhone connected you can go to Window->Devices, select your phone and press 'View Device Logs'. You will see a list with all the last crashes of the apps and with the information of the crash.

在连接了iPhone的Xcode中,您可以转到Window-> Devices,选择您的手机并按“查看设备日志”。您将看到一个列表,其中包含应用程序的所有最后崩溃以及崩溃的信息。

Regards

#2


0  

I got the solution. It is the run time. I reduced the file sizes to 10% of the original and everything runs fine. So I can test it and "improve" it to the speed limit of the iPhone 4S. :-)

我得到了解决方案。这是运行时间。我将文件大小减小到原始大小的10%,一切运行正常。所以我可以测试它并“改进”它到iPhone 4S的速度限制。 :-)

#1


3  

I think this is a memory problem with the iPhone 4S (200 mb for 4S is a lot). You should read the crash logs in Xcode.

我认为这是iPhone 4S的内存问题(4S的200 mb很多)。您应该阅读Xcode中的崩溃日志。

In Xcode with the iPhone connected you can go to Window->Devices, select your phone and press 'View Device Logs'. You will see a list with all the last crashes of the apps and with the information of the crash.

在连接了iPhone的Xcode中,您可以转到Window-> Devices,选择您的手机并按“查看设备日志”。您将看到一个列表,其中包含应用程序的所有最后崩溃以及崩溃的信息。

Regards

#2


0  

I got the solution. It is the run time. I reduced the file sizes to 10% of the original and everything runs fine. So I can test it and "improve" it to the speed limit of the iPhone 4S. :-)

我得到了解决方案。这是运行时间。我将文件大小减小到原始大小的10%,一切运行正常。所以我可以测试它并“改进”它到iPhone 4S的速度限制。 :-)