Visual Studio 在远程调试 Cordova iOS 应用程序时挂起
Visual Studio hangs when remote debugging a Cordova iOS app
我使用 Visual Studio 2013 和 'Tools for Apache Cordova'。在 Cordova 工具的设置页面 'Remote Agent Configuration' 中,我启用了 iOS 远程处理。
在 iOS Cordova 应用程序的远程调试期间,当我设置断点以检查 cordova 插件的结果时 Visual Studio 挂起。然后我需要重新启动 Visual Studio.
在调用 Cordova 插件之前执行的行上的断点没有问题...还将 Cordova 插件的结果存储在变量中,然后使用另一个单击事件处理程序检查它。
其他人是否也注意到了这个问题?你能修好吗?
我自己写的插件也有同样的问题。
尝试让您的插件 运行 处于后台线程中。然后调试应该没有问题。看下面的代码片段:
- (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;
}
我使用 Visual Studio 2013 和 'Tools for Apache Cordova'。在 Cordova 工具的设置页面 'Remote Agent Configuration' 中,我启用了 iOS 远程处理。
在 iOS Cordova 应用程序的远程调试期间,当我设置断点以检查 cordova 插件的结果时 Visual Studio 挂起。然后我需要重新启动 Visual Studio.
在调用 Cordova 插件之前执行的行上的断点没有问题...还将 Cordova 插件的结果存储在变量中,然后使用另一个单击事件处理程序检查它。
其他人是否也注意到了这个问题?你能修好吗?
我自己写的插件也有同样的问题。
尝试让您的插件 运行 处于后台线程中。然后调试应该没有问题。看下面的代码片段:
- (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;
}