Soon after iOS was developed, it was debugged in the simulator because there was no money to join the Apple developer program. And before the real machine debugging is also quite complex (compared to Android too much complexity), specifically visible in this article-iOS development 0 Basic teaching thread true machine debugging process.
After Xcode7, developers can use the Apple ID for free debugging and easy to use. After referring to the other articles, I took my first example of the Apple Tutorial-todolist in a touch.
Two steps: Add Apple ID to generate provisioning file, run the add Apple ID on the real machine
First open the Xcode preferences, and then select tab Accounts
Click "+" in the lower left corner to add the Apple ID,
After adding, click the "View Details ..." in the lower right corner.
In the dialog box that pops up, click "Create" for "IOS Development"
At this point, we complete the addition of the Apple ID
As you can see from the image above, Apple has opened up two capabilities for the free Apple ID: IOS Development and Mac Development, where we focus only on the former generation of provisioning file, running on the real machine
At this point we open an iOS project, where I use the Apple's official first project as an example
You can see the general information inside there is a warning message "No provisioning profiles found", we click "Fix Issue"
Xcode will prompt us to select an account, and we select the Apple ID account that was previously added
Then Xcode will automatically create a corresponding "provisioning profile"
This time I did not connect the real machine, then the following prompts appear
It means that no real machine has been found.
At this point, just connect to the real machine, and then you can run the app on the real machine. refer to using Xcode 7 Beta free real Machine Debug iOS app