【问题标题】:Xcode Version 7.1 beta 3 Cannot attach to process when debugger is enabledXcode 7.1 beta 3 启用调试器时无法附加到进程
【发布时间】:2016-01-06 08:13:19
【问题描述】:

我无法再将我的应用程序安装到我的 iPhone 6 上。 (在可执行文件中启用调试器,禁用时它安装得很好)

我需要从我的设备获取一些日志记录,但是当我在可执行文件中启用调试功能安装它时,它无法附加该进程,并且该进程不会保持活动状态。我需要重新启动应用程序,并且当我在运行后尝试附加该进程时,它将无法正常工作。 (错误:无法附加到进程 ID xxxx)

当我查看我的设备时,根本没有日志。

在设备调试日志下方:

Oct  9 21:07:25 iPhone-Jurgend wifid[249] <Error>: WiFi:[466110445.299905]: Disable WoW requested by "IMDMessageServic"
Oct  9 21:07:25 iPhone-Jurgend IMDMessageServicesAgent[4483] <Warning>: WiFi is associated YES
Oct  9 21:07:25 iPhone-Jurgend IMDMessageServicesAgent[4483] <Warning>: WiFi is associated YES
Oct  9 21:07:27 iPhone-Jurgend searchd[4408] <Warning>: ====^^^^ DuetExpert missing data, count -> people:8 applicationDeepLinks:0 applications:8 requests:7 missingAllDataRequests:0
Oct  9 21:07:27 iPhone-Jurgend SpringBoard[4402] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Oct  9 21:07:28 iPhone-Jurgend securityd[1033] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Oct  9 21:07:28 iPhone-Jurgend securityd[1033] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Oct  9 21:07:28 iPhone-Jurgend amfid[4485] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Oct  9 21:07:29 iPhone-Jurgend kernel[0] <Notice>: xpcproxy[4484] Container: /private/var/mobile/Containers/Data/Application/72E27621-2237-4B8F-8B0F-E934ED0AC1CD (sandbox)
Oct  9 21:07:29 iPhone-Jurgend SpringBoard[4402] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  9 21:07:29 iPhone-Jurgend SpringBoard[4402] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  9 21:07:29 iPhone-Jurgend SpringBoard[4402] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  9 21:07:29 iPhone-Jurgend SpringBoard[4402] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  9 21:07:29 iPhone-Jurgend SpringBoard[4402] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  9 21:07:29 iPhone-Jurgend SpringBoard[4402] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>:  didFinishLaunchingWithOptions
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>:    INFO: Localization changed from nl_BE to en_BE
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>:  dbPathString: /var/mobile/Containers/Data/Application/72E27621-2237-4B8F-8B0F-E934ED0AC1CD/Documents/myDb.db
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>:    INFO: Localization changed from nl_BE to en_BE
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>:    INFO: Localization changed from nl_BE to en_BE
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>: localeIdentifier: en_BE
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>: localeNameForKey: English (Belgium)
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>:    INFO: Localization changed from nl_BE to en_BE
Oct  9 21:07:29 iPhone-Jurgend myDiveApp[4484] <Warning>:    INFO: Localization changed from nl_BE to en_BE
Oct  9 21:07:32 iPhone-Jurgend MobileSMS[4454] <Warning>: plugin com.swiftkey.SwiftKeyApp.Keyboard invalidated
Oct  9 21:07:33 iPhone-Jurgend myDiveApp[4484] <Warning>: Closed DB for applicationDidEnterBackground
Oct  9 21:07:33 iPhone-Jurgend SpringBoard[4402] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Oct  9 21:07:33 iPhone-Jurgend myDiveApp[4484] <Warning>: *** Error: 1000 Failed from sqlite3_exec('UPDATE SyncSettings SET lastExecCommand='2015-10-09 19:07:33 +0000' WHERE Id='7''). Error is: 'library routine called out of sequence'
Oct  9 21:07:34 iPhone-Jurgend syncdefaultsd[4486] <Notice>: (Note ) marked "com.me.keyvalueservice" topic as "enabled" on <APSConnection: 0x156d138e0>
Oct  9 21:07:36 iPhone-Jurgend MobileGestaltHelper[1036] <Error>: libMobileGestalt MobileGestalt.c:276: server_access_check denied access to question UniqueDeviceID for pid 4486
Oct  9 21:07:36 iPhone-Jurgend syncdefaultsd[4486] <Error>: libMobileGestalt MobileGestaltSupport.m:151: pid 4486 (syncdefaultsd) does not have sandbox access for re6Zb+zwFKJNlkQTUeT+/w and IS NOT appropriately entitled
Oct  9 21:07:36 iPhone-Jurgend syncdefaultsd[4486] <Error>: libMobileGestalt MobileGestalt.c:537: no access to UniqueDeviceID (see <rdar://problem/11744455>)
Oct  9 21:07:40 iPhone-Jurgend streaming_zip_conduit[4488] <Warning>: LaunchServices: installing app for existing placeholder <LSApplicationProxy: 0x1276191e0> be.dictus.Test <(null) *Not found in database*>
Oct  9 21:07:40 iPhone-Jurgend streaming_zip_conduit[4488] <Warning>: LaunchServices: Not creating progress for <LSApplicationProxy: 0x1276191e0> be.dictus.Test <(null) *Not found in database*> since it is not a placeholder.
Oct  9 21:07:40 iPhone-Jurgend installd[4359] <Notice>: 0x16e12f000 -[MIClientConnection installPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/myDiveApp.app_sparse.ipa" type Developer (LSInstallType = (null)) requested by streaming_zip_conduit (pid 4488)
Oct  9 21:07:40 iPhone-Jurgend SpringBoard[4402] <Warning>: UNNotificationRegistrarConnectionListener connection invalidated
Oct  9 21:07:40 iPhone-Jurgend com.apple.xpc.launchd[1] (UIKitApplication:be.dictus.Test[0x1fc4][4484]) <Notice>: Service exited due to signal: Killed: 9
Oct  9 21:07:40 iPhone-Jurgend SpringBoard[4402] <Warning>: Application 'UIKitApplication:be.dictus.Test[0x1fc4]' exited abnormally via signal.
Oct  9 21:07:40 iPhone-Jurgend installd[4359] <Notice>: 0x16e087000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundlePatch ID=be.dictus.Test; Version=20150929000023, ShortVersion=20150928000023>
Oct  9 21:07:40 iPhone-Jurgend installd[4359] <Notice>: 0x16e087000 -[MIInstallableBundlePatch applyPatchWithError:]: Attempting patch update of be.dictus.Test from 20150929000023 (20150928000023) to 20150929000023 (20150928000023)
Oct  9 21:07:40 iPhone-Jurgend misagent[4269] <Notice>: attempt to install invalid profile: 0xe8008012
Oct  9 21:07:40 iPhone-Jurgend installd[4359] <Error>: 0x16e087000 -[MIInstallableBundle _installEmbeddedProfileInBundle:]: Could not install embedded profile: 0xe8008012 (This provisioning profile cannot be installed on this device.)
Oct  9 21:07:41 iPhone-Jurgend securityd[1033] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Oct  9 21:07:41 iPhone-Jurgend securityd[1033] <Error>:  secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Oct  9 21:07:41 iPhone-Jurgend installd[4359] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Oct  9 21:07:41 iPhone-Jurgend installd[4359] <Notice>: 0x16e087000 -[MIInstallableBundle _refreshUUIDForContainer:withError:]: Data container for be.dictus.Test is now at /private/var/mobile/Containers/Data/Application/85FF8F2F-DD5D-4178-8772-E3ADF98FDD5C
Oct  9 21:07:41 iPhone-Jurgend installd[4359] <Notice>: 0x16e087000 -[MIContainer makeContainerLiveReplacingContainer:reason:withError:]: Made container live for be.dictus.Test at /private/var/mobile/Containers/Bundle/Application/10108176-D834-4322-840A-EA0C18CFA353
Oct  9 21:07:41 iPhone-Jurgend installd[4359] <Notice>: 0x16e087000 -[MIInstaller performInstallationWithError:]: Install Successful; Staging: 0.00s; Waiting: 0.00s; Preflight/Patch: 0.35s, Verifying: 0.20s; Overall: 1.20s
Oct  9 21:07:41 iPhone-Jurgend pkd[4264] <Warning>: releasing plug-in hold 3FA1E042-EFE9-4C78-8A2D-DC96149714E2 at client's request

安装过程似乎有问题: LaunchServices:未为 be.dictus.Test 未在数据库中找到>创建进度,因为它不是占位符。

【问题讨论】:

  • 不要单击“查看设备日志”,而是展开设备窗口底部的文本区域以查看设备控制台消息。里面有什么与您的应用程序的安装或启动相关的内容吗?
  • Xcode 有一个 PID,所以应用程序必须已经启动。但是查看设备日志仍然可能会有所帮助。搜索来自“debugserver”的日志 - 这是在设备上运行的调试器代理,您可能会看到一些关于为什么尝试获取任务端口被拒绝的系统消息。这些应该提供更多提示。
  • 另外,请确保您正在构建应用程序的调试而不是发布配置。在系统允许调试器附加到应用程序之前,应用程序需要特定的权利,Xcode 会自动将该权利添加到 Debug 配置中,但不会添加到 Release 配置中。
  • 该方案是调试方案,(我仔细检查了)不,那里没有设备日志@Phillip:你的意思是什么文本区域,我的设备屏幕上的 al 是白色和空的
  • 白色区域的左下角有一个小控件。

标签: ios xcode debugging logging


【解决方案1】:

尝试两件事:

  1. 重启设备

  2. 重启 Xcode

在这种情况下总是值得尝试 :) 如果真的绝望,也请重新启动您的 Mac!

【讨论】:

  • 试了两三次都没有成功
【解决方案2】:

我通过清理 info.plist 解决了这个问题。

  • 在 C 编译器设置中删除了 -DNS_BLOCK_ASSERTIONS=1
  • 将隐式布尔转换设置为“是”
  • 将生成分析代码设置为“否”

【讨论】:

    猜你喜欢
    • 2015-12-12
    • 2018-06-05
    • 2012-03-21
    • 1970-01-01
    • 2018-08-15
    • 2020-04-17
    • 2012-07-17
    • 1970-01-01
    • 2023-03-07
    相关资源
    最近更新 更多