菜鸟教程小白 发表于 2022-12-11 17:54:57

ios - XCode 同时调试主应用程序和今天的扩展程序


                                            <p><p>我想同时获取<code>main app</code>、<code>today-extension</code>调试信息。</p>

<p>我运行了 <code>main app</code> 方案,只得到了 <code>main app</code> 调试信息。<br/>
我尝试通过 <code>Process Identifier(today-extension id)</code> 附加,但是当我选择 <code>today-extension</code> 进程时它是空白的。 </p>

<p>我该怎么办?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><blockquote>
<p>Basically select the Watch App as the scheme in xcode, hit build+run
which will build the iOS app and WatchKit app, install the WatchKit
app on to the Watch and attach the debugger to the WatchKit Extension.
Then in xcode select the iOS app in the scheme selector and select the
iPhone as the target device, launch the iOS app by tapping the app
icon on the phone and in xcode in the menu bar select &#34;Debug &gt; Attach
to Process&#34; and select your app in the list. This should result in
having xcode attached to both processes at the same time. If you want
to debug something early in the iOS app&#39;s lifecycle you can select
&#34;Debug &gt; Attach to Process by PID or Name...&#34; and type in the process
name of the iOS app prior to launching it manually. This way the
debugger will be attached right when the app launches.</p>
</blockquote>

<p>来自 Apple 开发者 <a href="https://forums.developer.apple.com/thread/16003" rel="noreferrer noopener nofollow">site</a> .</p>

<p>请注意,他们讨论的是 WatchKit,但 Today Extension 也是如此。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - XCode 同时调试主应用程序和今天的扩展程序,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40198925/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40198925/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - XCode 同时调试主应用程序和今天的扩展程序