iOS9 共享扩展无法在 Xcode 上调试 [英] iOS9 Share Extension can not debug on Xcode

查看:41
本文介绍了iOS9 共享扩展无法在 Xcode 上调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从 Xcode 为真实设备构建共享扩展时,Xcode 任意停止调试.但是当我为模拟器启动时,问题没有发生.

When I build share extension from Xcode for the real device, Xcode arbitrarily stop debug. But when I launch for simulator, the problem does not occur.

环境
Xcode 7.1.1
iOS 9.1

Environment
Xcode 7.1.1
iOS 9.1

详情
当我构建共享扩展时,Xcode 显示已在 iPhone 上运行 MobileSafari.app",但 Safari 没有运行.并且,方形停止按钮为任意灰色.所以,我自己启动 Safari 并选择我的扩展和发布.调试部分不显示任何内容.此外,URL 请求不会发送到 Rails 服务器.

Details
When I build share extension, Xcode shows "Finished running MobileSafari.app on iPhone", but Safari does not run. And, The square stop button is arbitrarily gray. So, I launch Safari by myself and choose my extension and post. The debug section does not show anything. Also, URL request is not sent Rails server.

这是我为真实设备构建共享扩展时的图片.

This is the picture when I build the share extension for the real device.

我不知道为什么真机无法在 Xcode 上启动共享扩展.
如果有人知道这个问题的答案,请告诉我.

I do not know why the real device can not launch share extension at Xcode.
If anyone know the answer about this problem, please tell me.

推荐答案

通常,您可以通过转到调试"->附加到进程或 PID"并输入共享扩展的名称来调试共享扩展.从那里你可以在你的设备或模拟器上打开共享扩展,Xcode 的调试器应该正确地附加和命中断点.但是,我注意到执行此操作时不会显示日志消息,也不会为调试器视图中的变量填充值.

Typically you can debug a share extension by going to Debug -> Attach to process or PID and entering the name of your share extension. From there you can open the share extension on your device or simulator and Xcode's debugger should attach and hit breakpoints correctly. However, I've noticed that log messages do not show up when doing this, nor do values populate for variables in the debugger view.

这是我如何让调试正常工作.运行共享扩展方案.当它询问您要运行什么应用程序时,选择照片"(因为这是您的扩展程序将在其中运行的应用程序).然后照片应用程序将在您的设备上启动,您可以继续使用您的扩展程序.Xcode 中的调试器应该会按预期工作.

Here's how I got the debugging to work correctly. Run the share extension scheme. When it asks you what app to run, chose 'Photos' (because that's the app your extension will operate in). The Photos app will then launch on your device and you may proceed to use your extension. The debugger in Xcode should then work as expected.

这篇关于iOS9 共享扩展无法在 Xcode 上调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆