Currently, iOS programs developed on XCode can only run in the simulator. If you want to test them on a real device, you need an Apple-certified developer account and purchase a developer certificate iDP, which costs $99 a year! As a novice who just started learning iOS programming, it really hurts to spend such a large amount of money... After a lot of trouble, and referring to the posts of various masters, I finally succeeded in compiling and running it on a real machine! I will share the method with you here. My operating environment is: [Computer] XCode6.0.1 + OS X 10.9.5 [Real iPod Touch] iOS6.1 Preparation: 1. First, you need to have a jailbroken iPhone/iPod/iPad. The jailbreaking method is not provided here. 2. Add the source http://apt.weiphone.com to the Cydia of the real device used for testing, and download AppSync suitable for the system version of the real device. 3. Create a certificate on your computer to sign the generated program. Create a certificate The process of creating a certificate is relatively simple. Open "Others-Keychain Access" on your computer. Then click "Keychain Access-Certificate Assistant-Create Certificate..." in the menu bar to open the wizard. Pay attention to the three places here. You must name it iPhone Developer, set the type to code signing, and select "Let me override these defaults". You don't need to change anything in the subsequent steps. Click "OK" and "Continue" all the way to complete the wizard. 4. If Xcode is running, press Command+Q to completely close it. Then open "Others-Terminal". We need to use some UNIX commands, which may seem cumbersome, but believe me, this saves $99 per year! ① Enter the iPhone SDK directory, the instructions are as follows:
Note: Different versions of Xcode*** have different version numbers. In Xcode 6.0, it is iPhoneOS8.0.sdk. Future versions may have higher versions, and earlier versions may have lower versions. Please change it according to the actual situation. (If you really don't know your version number, you can use the "ls" command to view all files.) ② Back up the original file. If the computer has a password, the system will prompt you to enter the password (it will not be displayed after entering, just press Enter)
③ Edit the configuration file SDKSettings.plist In order to facilitate modification, we can directly open this file with Xcode. First, open the directory where this file is located:
Double-click SDKSettings.plist in the pop-up Finder window. This will launch the Xcode graphical interface. Expand the DefaultProperties branch and change the following ENTITLEMENTS_REQUIRED and CODE_SIGNING_REQUIRED properties to NO. Note: You may encounter a system prompt [“SDKSettings.plist” is locked for editing…], which is due to file read and write permission issues. The solution is as follows: First, modify the folder permissions. At this time, we are in the directory iPhoneOS8.0.sdk. If we enter the command "cd .." to return to the parent directory, and "ls -al" to view all files, we will find that the system displays iPhoneOS8.0.sdk -> iPhoneOS.sdk, which means that iPhoneOS8.0.sdk is a shortcut to iPhoneOS.sdk, so the real folder we want to modify is iPhoneOS.sdk. The command is as follows:
Then, modify the read and write permissions of all files in the folder: sudo chmod 777 * Now double-click to open SDKSettings.plist, and you will find that the properties that could not be modified just now can be modified! ④ Edit another configuration file Info.plist
Double-click Info.plist in the Finder window that pops up. Change all XCiPhoneOSCodeSignContext to XCCodeSignContext in three places: DefaultProperties, RuntimeRequirements, and OverrideProperties. Note: Same as step ③, you may encounter permission issues. Just modify the permissions of the Platforms folder and all files in the folder. Follow the same steps as above. 5. Prepare a custom post-generation script (this step needs to be done online)
6. Modify project settings Note: Modifying configuration files and preparing scripts before this stage only needs to be done once. However, the operations in this stage must be done for each project that requires real machine debugging. ① Disable Xcode's automatic signing operation Set all Code Signing options in the project configuration "Build Settings" to Don't Code Sign, as shown in the figure. ② Add a custom post-build script In Build Phases, click the "+" sign in the upper left corner, add a "New Run Script Phase", and enter the following script:
via:LiuLiu's notebook Now the configuration is complete!!! Connect your iPhone/iPod/iPad, compile and run, and when you see the program running on the real screen, you will have saved $99!!! I would like to thank the great post for providing a complete guide to Xcode 5 + iOS 7 certificate-free (iDP) real device debugging and generating IPA. |
<<: Those UNIX classics forgotten by the years
>>: Hammer cuts prices, is sentiment bankrupt?
Fang Dahai's five acupoints basics and applic...
Data is an important component and evaluation cri...
Red wine, two Milans, a country that looks like a...
As the holiday time continues to extend due to th...
There are many theories or conjectures about cosm...
Unlike the Honor series of mobile phones, which a...
[[266330]] Recently, after Huawei was hit by US t...
With the fading of traffic dividends in recent ye...
[51CTO.com original article] Data Xiaobai started...
In Queensland, Australia, there is one of the mos...
According to the official Weibo of Guangdong Prov...
1. What is content operation ? 2. Judgment Abilit...
2024 is the Year of the Dragon in the lunar calen...
This year is the Year of the Dragon, and a series...
The author disassembled Li Jiaqi 's private d...