Ios dev

running app on device

 * register apple id on https://developer.apple.com/, buy iOS develop programme
 * Genreate CSR from your mac, keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority ...
 * input 'User Email Address', 'Common Name: Yufei', 'CA Email' leave empty, select Save to disk, then click continue. Save the CSR
 * Use the CSR file generate develop certificate
 * Use the CSR generate app store certificate
 * Create app id for iOS portal
 * add your device to iOS portal
 * Generate your develop Provisioning file use certificate + app id + device
 * Download the provisioning file, add to you Xcode, then the app can build and run your device.