如何在实际设备上调试Apple watch app?

时间:2015-05-22 09:58:16

标签: ios debugging breakpoints apple-watch xcode6.3

我想调试苹果手表应用程序(前景)和iOS应用程序(背景)

原因是因为我在Apple Watch扩展程序中使用此代码在后台打开iOS应用程序以进行服务调用:

$xml = new DOMDocument();
$xml->load('ORA1707220-05-2015--16-48-31.xml');
$root = $xml->getElementsByTagName('OrderResponse');
$tree = $root->item(0);

parse($tree);

function parse($tree){
    $child = $tree->childNodes;

    foreach($child as $children){
        switch($children->nodeName){
             //Case
                 //instructions
        }


        if($child->hasChildNodes())
            parse($child);
        }

 }

我想在这里设置一个断点来检查是否有回复:

    [WKInterfaceController openParentApplication:@{@"key":@"loadRecentData"} reply:^(NSDictionary *replyInfo, NSError *error) {...

enter image description here

Jesse Tayler建议的解决方案给出了这个错误:

enter image description here

2 个答案:

答案 0 :(得分:3)

使用 - >调试 - >附加到流程...菜单,您就可以调试

答案 1 :(得分:3)

从方案中选择watchkit app。在“配对iPhone +手表”中运行此功能。在手表中启动应用程序。现在您可以调试代码了。我试过这个并且正在为我工​​作。我使用的是xcode 7.2。

相关问题