远程调试Cordova iOS应用程序时,Visual Studio会挂起

时间:2015-04-30 15:04:41

标签: visual-studio cordova remote-debugging visual-studio-cordova

我使用Visual Studio 2013和Apache Cordova'工具。在设置页面中,远程代理配置'在Cordova工具中,我启用了iOS远程处理。

在iOS Cordova应用程序的远程调试期间,当我设置断点以检查cordova插件的结果时,Visual Studio会挂起。然后我需要重新启动Visual Studio。

在调用Cordova插件之前执行的行上的断点正常工作...还将Cordova插件的结果存储在变量中,然后使用另一个单击事件处理程序检查它。

其他人是否也注意到这个问题?你能解决它吗?

1 个答案:

答案 0 :(得分:0)

我对自编插件也有同样的问题。

尝试让您的插件在后台线程中运行。然后调试应该没有问题。请查看以下代码段:

- (void)myMethod:(CDVInvokedUrlCommand*)command
{
       NSString* callbackId = command.callbackId;

       [self.commandDelegate runInBackground:^{
             // your plugin logic comes here

             // successful plugin execution
             CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"success"];
             [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
       }

       return;
}
相关问题