Mohsen Bahman
Mohsen Bahman

Reputation: 1092

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

I'm new to iOS and Swift . I want to debug my app in real device not simulator without a developer account ,like Android apps debug using Android Studio.

I have a jailbroken iOS device and I'm using xcode 6.2

Anyway I want a step to step debug of my app and seeing the device logs when any parameter or variable is changing. After times of search I want to ask directly : WHAT SHOULD I DO...

someone help me, please...

I appreciate your answers in advance.

Upvotes: 0

Views: 3871

Answers (2)

sbsr
sbsr

Reputation: 362

first that's ways better to have an account for developing purposes! anyway there's a way should do the trick.

as there is no up to date answers out there for new versions of ios and Xcode i show it in some details.

first you should download "Appsync Unified" from "cydia.angelxwind.net" cydia repo to your device.

and then you can continue these steps

first open Applications,on xcode click Show Package Contents and go to through these paths:

Contents -> Developer -> Platforms -> iPhoneOS.platform -> Developer -> SDKs -> iPhoneOS.sdk -> SDKSettings.plist

copy SDKSetting.plist to somewhere in case of changing the values.

in DefualtProperties section change :

ENTITLEMENTS_REQUIRED to YES

CODE_SIGNING_REQUIRED to NO

AD_HOC_CODE_SIGNING_ALLOWED to YES

enter image description here

close Xcode if it’s open and reopen it. go to Build Settings of the project.(notice that you must select the Project not Target)

enter image description here

in Code Signing section change :

Code Signing Identity to Ad Hoc Code Sign

now Debug and Realese should change to Ad Hoc Code Sign as well.

now create new file -> Resources -> Property List

enter image description here

set it’s name to Entitlements.plist

add an item and it should be Can be debugged and set the value to YES

enter image description here

now go back to Build Settings, in Code Signing section and change :

Code Signing Entitlements to Entitlements.plist

enter image description here

now you can easily set the device target to your jailbroken device and run it.

Upvotes: 6

Nimit Parekh
Nimit Parekh

Reputation: 16864

There don’t seem to be many tutorials out there telling you how to do this for iOS8.1 and XCode 6.1 (they are all a bit outdated), but this is what worked:

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

Now XCode can run and debug the app. Good luck

Upvotes: 3

Related Questions