应用程序启动后仪器泄漏停止
所以我想使用 Leaks 来查找我的应用程序中的泄漏。在 Xcode 中,我转到“产品”,然后点击“配置文件”。在“仪器”中,我选择“泄漏”,然后它就会启动。 我的应用程序正在启动并且 Leaks 正在运行。但是,当我的应用程序完成启动并且我可以使用它时,泄漏就会停止。
还有其他人遇到同样的问题或者知道如何解决这个问题吗?
So I want use Leaks to find the leaks in my app. In Xcode, I go to "Product" and then hit "Profile". In Instruments I select Leaks and it starts.
My app is starting and Leaks is running. But just as soon as my app is finished starting and I can use it, Leaks stops.
Is there anybody else with the same problem or maybe knows how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我会为所有发布、调试模式选择一个开发配置文件,清理模拟器,清理 xcode,然后我将启动仪器
I would chose a development profile for all release,debug modes, clean the simulator, clean xcode ,then i would launch instruments
在应用程序收到大量内存警告后,Leaks 工具似乎会关闭。关闭所有后台应用程序会有所帮助。
The Leaks instrument seems to close after the app receives lot of memory warnings. Closing all background applications helps.
清理项目构建文件夹,关闭 XCode IDE 并清理 MAC Os 缓存,然后它应该可以工作。如果它是一个 iOS 项目,您必须在重新编译之前从模拟器/设备中删除应用程序。
clean project build folder, close XCode IDE and clean MAC Os caches then it should work. if it's an iOS project you have to delete app from simulator/device before re compile it.
我见过在构建应用程序并在物理设备上运行时使用不正确的配置文件时会发生这种情况。
在模拟器中运行它时,您不应该看到这种错误 - 它应该按预期工作。如果您在这种情况下使用模拟器并且仍然看到这种行为,我建议您访问 http:// bugreport.apple.com 并提交有关此问题的错误,提供尽可能多的详细信息。
如果您使用的是物理设备,请确保您使用有效的配置文件和证书/密钥对,并且该设备包含在配置文件中。
I've seen this happen when an incorrect provisioning profile is used when building the app and running on a physical device.
You shouldn't see this kind of error when running it in the simulator - it should work as intended. If you're using the simulator in this situation and are you still seeing this behaviour, I would encourage you to go to http://bugreport.apple.com and file a bug regarding this issue, giving as much detail as you possibly can.
If you're using a physical device, ensure you're using a valid provisioning profile and certificate/key pair and that the device is included in the profile.
如果您使用 Cocoapods,请确保您未选中 Target > 中的
仅在安装时运行脚本
。构建阶段> [CP] 嵌入式 Pod 框架。检查此选项给我带来了同样的问题。If you use Cocoapods, be sure, you have unchecked
Run script only when installing
in Target > Build Phases > [CP] Embedded Pods Framework. Checked this option caused same problem for me.这就是我的情况。
如果您使用的是真实设备,请确保您使用有效的配置文件(开发配置文件)并且该设备包含在配置文件中。 此处有更详细的说明。
That was my case.
If you're using a real device, make sure you're using a valid provisioning profile (development provisioning profile) and that the device is included in the profile. More detailed explanation here.