1,打开终端执行
sudo chmod -R 777 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
2,然后打开文件夹
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist
修改CODE_SIGNING_REQUIRED字段为YES
重新启动Xcode 就可以真机测试了!!!!