如何使用 xcode 6.2 在越狱设备中调试 iOS 应用程序

How to debug iOS apps in a jailbroken device with xcode 6.2

我是 iOS 和 Swift 的新手。我想在没有开发者帐户的情况下在真实设备而不是模拟器中调试我的应用程序,例如 Android 应用程序调试使用 Android Studio。

我有一个越狱的 iOS 设备,我正在使用 xcode 6.2

无论如何,我想要一个步骤来逐步调试我的应用程序,并在任何参数或变量发生变化时查看设备日志。经过多次搜索我想直接问:我应该做什么...

有人帮帮我,拜托...

提前感谢您的回答。

首先,最好有一个用于开发目的的帐户! 无论如何,有一种方法可以解决问题。

因为 ios 和 Xcode 的新版本没有最新的答案,所以我会详细说明。

首先你应该从 "cydia.angelxwind.net" cydia repo 下载 "Appsync Unified" 到你的设备。

然后您可以继续这些步骤

首先打开应用程序,在 xcode 上单击显示包内容并通过这些路径转到:

内容 -> 开发人员 -> 平台 -> iPhoneOS.platform -> 开发人员 -> SDK -> iPhoneOS.sdk -> SDKSettings.plist

将 SDKSetting.plist 复制到某个地方以防更改值。

在 DefualtProperties 部分更改:

ENTITLEMENTS_REQUIRED 是

CODE_SIGNING_REQUIRED 到否

AD_HOC_CODE_SIGNING_ALLOWED 是

关闭 Xcode 如果打开并重新打开它。转到项目的构建设置。(请注意,您必须 select 项目而不是目标)

在代码签名部分更改:

临时代码签名的代码签名身份

现在 Debug 和 Realese 也应该更改为 Ad Hoc Code Sign。

现在创建新文件 -> 资源 -> 属性 列表

将其名称设置为 Entitlements.plist

增加一项,应该可以调试,设置值为YES

现在返回构建设置,在代码签名部分更改:

Entitlements.plist

的代码签名权利

现在您可以轻松地将设备目标设置为您的越狱设备并运行它。

似乎没有很多教程告诉您如何为 iOS8.1 和 XCode 6.1 执行此操作(它们都有点过时),但这就是工作:

  1. On your Jailbroken device install AppSync Unified 5.2-1 (or later) from AngelXWind’s repo. Don’t use any other AppSync, and if you have others, be sure to remove them.
  2. Open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and change AD_HOC_CODE_SIGNING_ALLOWED to YES. You may need to duplicate it to the desktop, change it, save it, then drag and drop back into the original folder because OS X let you edit the file in place.
  3. If XCode was running, restart XCode.
  4. Change your Project and Target settings to Ad Hoc Code Sign in Build Settings

  5. Tell XCode to run app on iPhone. At this point XCode will put app on your iDevice, but can’t debug because it can’t attach to the process. The app will start then close immediately. You can now manually start the app on the phone now though.

  6. To enable debugging: In your project select File>New File Property List and create a file called “Entitlements.plist”. Add “Can be debugged” or “get-task-allow” (both do the same thing) and set the value to YES.
  7. Now change your Project and Target Code Signing Entitlements (In Build Settings) to “Entitlements.plist” (you have to type it in).

现在 XCode 可以 运行 调试应用程序。祝你好运