OS X 10.10.3 + XCode6.3.1 + IOS7 jailbreak machine real-Machine debugging

Source: Internet
Author: User

Recently developing an iOS app, the developer account is borrowed, so the program can only be debugged in the emulator. Later on the internet to find some real-machine debugging tutorials, but some vague, some practice down does not work. After groping and synthesizing the contents of several articles, it was finally settled. In order to prevent future use of the time to detours, but also to help people who have the same needs, here to write down my whole process.

    1. Create a certificate

Open Utility - keychain Access . Then click Keychain Access-Certificate assistant-Create a certificate in the menu bar to open the wizard. The first step is important, you must name the iPhone Developer, set the type to code signing , and select Let me override these defaults . After the steps do not need to change, just click " OK " and " continue " To complete the wizard can!

2. Modify the Xcode configuration

A) sdksettings.plist

Open the application, locate Xcode, and right-click to Display the package contents . Enter the/contents/developer/platforms/iphoneos.platform/developer/sdks/iphoneos8.3.sdk/directory (different versions of the Xcode SDK version directory). You can see the sdksettings.plist file. Copy it to your usual working directory for the following modifications:

Under the Defaultproperties property, locate the code_signing_required field, change the property to NO; Find the entitlements_required field, Also change its property value to NO.

After the modification, copy the saved files to the above directory to overwrite the source files.

b) info.plist

Similarly, open the application, find Xcode, and right-click to display the package contents. Enter the/contents/developer/platforms/iphoneos.platform/directory in turn. You can see the Info.plist file. Copy it to your usual working directory and make the following changes:

Find all the code_sign_context_class fields and modify their property values to Xccodesigncontext.

After the modification, copy the saved files to the above directory to overwrite the source files.

3. Add a script file

Open Terminal, enter the following command

Mkdir/applications/xcode.app/contents/developer/iphoneentitlements

Cd/applications/xcode.app/contents/developer/iphoneentitlements

Curl-o Http://www.alexwhittemore.com/iphone/gen_entitlements.txt

MV Gen_entitlements.txt gen_entitlements.py

chmod 777 gen_entitlements.py

  4. Modify the project configuration (needs to be set for each project that requires real-machine debugging)

A) disabling automatic signing

Open the Xcode project file and set all the options in code Signing identity in buildsettings to Don ' t Code sign

b) Add custom Build Script

With the Xcode project selected, select Xcode->editor->add build phase->add Run Script build Phase to add the following script

Export codesign_allocate=/Applications/Xcode.app/Contents/Developer/Platforms/Iphoneos.platform/Developer/Usr/Bin/codesign_allocateif["${platform_name}"=="Iphoneos" ]; Then/Applications/Xcode.app/Contents/Developer/Iphoneentitlements/gen_entitlements.py"My.company.${project_name}" "${built_products_dir}/${wrapper_name}/${project_name}.xcent"; Codesign-f-s"IPhone Developer"--entitlements"${built_products_dir}/${wrapper_name}/${project_name}.xcent" "${built_products_dir}/${wrapper_name}/"fi    

OK, all right, pick up your 5s and try it out.

5. Problems that may arise

A cannot find code object on disk error occurs, and if the code does not have a problem when compiling this issue, it is generally the last script where the problem occurs. There are two paths to the script in the run script code that you added in the project, so look carefully to see if the path here is consistent with your path.

There was a shell script invocation error error, and there was a problem in run script, and if it was entered manually, try copying my code.

OS X 10.10.3 + XCode6.3.1 + IOS7 jailbreak machine real-Machine debugging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.