Xamarin.iOS 调试器不附加 [英] Xamarin.iOS Debugger doesn't attach

查看:26
本文介绍了Xamarin.iOS 调试器不附加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个特定的应用程序,调试器不会将其附加到 Xamarin Studio.我们尝试了最新的稳定版和 Beta 版频道,但没有成功.它发生在模拟器或设备上.

We have a specific app that the debugger just won't attach with Xamarin Studio. We have tried the latest Stable and Beta channels with no luck. It happens in the simulator or on the device.

当调试器分离时,我们可以在 XCode 的控制台中看到:

When the debugger detaches, we can see this in XCode's console:

        Jun 18 15:41:51 Hitcents-iPad-2 kernel[0] <Debug>: lockbot[3258] Builtin profile: debugserver (sandbox)
        Jun 18 15:41:51 Hitcents-iPad-2 com.apple.debugserver-199[3270] <Warning>: Got a connection, waiting for debugger instructions.
        Jun 18 15:41:51 Hitcents-iPad-2 com.apple.debugserver-199[3270] <Warning>: 1 +0.000000 sec [0cc6/0303]: error: ::ptrace (request = PT_THUPDATE, pid = 0x0cc7, tid = 0x2503, signal = -1) err = Invalid argument (0x00000016)
        Jun 18 15:41:51 Hitcents-iPad-2 com.apple.debugserver-199[3270] <Warning>: 2 +0.004989 sec [0cc6/1303]: error: ::read ( 5, 0x2fe809fc, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
        Jun 18 15:41:51 Hitcents-iPad-2 com.apple.debugserver-199[3267] <Warning>: 1 +0.000000 sec [0cc3/0303]: error: ::read ( 5, 0x2fd4bebc, 1024 ) => 0 err = Bad file descriptor (0x00000009)
        Jun 18 16:55:11 Hitcents-iPad-2 mobile_installation_proxy[3471] <Error>: main: Could not receive request from host.
        Jun 18 16:55:11 Hitcents-iPad-2 mobile_installation_proxy[3468] <Error>: main: Could not receive request from host.
        Jun 18 16:55:12 Hitcents-iPad-2 BattlePillars[3474] <Warning>: MonoTouch: Debugger not loaded (disabled).

有什么想法吗?除了这个应用程序之外,其他应用程序都可以正常工作,我们看不出这个特定应用程序有什么不同会导致它.

Any ideas? Other apps besides this one work fine, and we can't see any difference in this specific app that would cause it.

我目前的版本是:

  • Xamarin Studio - 4.0.9
  • Xamarin.iOS - 6.3.6.77
  • XCode - 4.6.3
  • iOS - 可以是设备或模拟器,只试过 iOS 6.x
  • 此外,每个开发人员的 Mac 上都会发生,因此似乎特定于项目/解决方案

这是我的项目文件的片段:

Here is the snippet of my project file:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
    <ProductVersion>10.0.0</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{07958BCE-7F33-4F8F-9A86-5102FF4632FB}</ProjectGuid>
    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Exe</OutputType>
    <RootNamespace>MyAppName</RootNamespace>
    <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
    <AssemblyName>MyAppName</AssemblyName>
  </PropertyGroup>

<!--Further down-->

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
        <Optimize>False</Optimize>
        <OutputPath>bin\iPhone\Debug</OutputPath>
        <DefineConstants>DEBUG, IPHONE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <ConsolePause>False</ConsolePause>
        <MtouchDebug>True</MtouchDebug>
        <CodesignKey>iPhone Developer</CodesignKey>
        <CrashReportingApiKey />
        <MtouchI18n />
        <MtouchArch>ARMv7</MtouchArch>
        <IpaPackageName />
        <OptimizePNGs>false</OptimizePNGs>
        <MtouchLink>None</MtouchLink>
        <MtouchExtraArgs>-v -v -v</MtouchExtraArgs>
      </PropertyGroup>

解决方案:

有两个地方可以检查:

  • Project Options->iOS Build->Additional Options = 选中
  • 项目选项->编译器->常规选项->调试信息=完整

此外,我们有一个 Objective-C 绑定来解决需要此设置来修复调试版本的问题 (TestFlight):

In addition, we had an Objective-C binding compounding the issue (TestFlight) that needs this set to fix debug builds:

#if !DEBUG
     TestFlight.TakeOff("key");
#endif

否则它会在 Debug 中崩溃.

It would crash in Debug otherwise.

推荐答案

在项目的 iOS Build 选项中的附加 mtouch 参数中添加-v -v -v"(不带引号),重新编译,看看有没有打印出来到应用程序输出和(设备/系统)控制台.

Add "-v -v -v" (without quotes) to the additional mtouch arguments in the project's iOS Build options, recompile, and see if anything is printed to the Application Output and (Device/System) Console.

这篇关于Xamarin.iOS 调试器不附加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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