Xamarin.iOS调试器没有附加

时间:2013-06-18 20:47:44

标签: c# ios xamarin.ios xamarin

我们有一个特定的应用程序,调试器不会附加Xamarin Studio。我们尝试了最新的Stable和Beta频道但没有运气。它发生在模拟器或设备上。

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

        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).

有什么想法吗?除了这个应用程序之外的其他应用程序工作正常,我们在这个特定的应用程序中看不出会导致它的任何差异。

我目前的情况是:

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

以下是我的项目文件的片段:

<?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>

SOLUTION:

有两个地方需要检查:

  • 项目选项 - &gt; iOS构建 - &gt;其他选项=已选中
  • 项目选项 - &gt;编译器 - &gt;常规选项 - &gt;调试信息=完整

此外,我们有一个Objective-C绑定复合问题(TestFlight)需要这个集来修复调试版本:

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

否则会在Debug中崩溃。

2 个答案:

答案 0 :(得分:4)

是否有人意外关闭了调试器? :)检查项目选项 - &gt;构建 - &gt; iOS构建 - &gt;启用调试

答案 1 :(得分:3)

将“-v -v -v”(不带引号)添加到项目的iOS Build选项中的其他mtouch参数,重新编译,并查看是否有任何内容打印到应用程序输出和(设备/系统)控制台。

相关问题