真机调试用自己开发者账号,关键第三步

1.在Xcode中登录APPle ID账号和密码。

 
 

2.打钩Authomatially manage signing,Team选择自己的名字的(Personal Team)。

 
 

3.Build Setting里面Provisioning Profile和Provisioning Profile(Deprecated) 改为Automatic,Code Signing Identity改为iOS Developer,Development Team改为自己名字的(Personal Team)。

 
 
此时会报错,报错信息如下。
Failed to create provisioning profile.
The app ID "mxl.XLPaymentHUDExample" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
No profiles for 'mxl.XLPaymentHUDExample' were found
Xcode couldn't find a provisioning profile matching 'mxl.XLPaymentHUDExample'.

这时解决办法是需要改Bundle Identifier去一个自己定义的名字。


 
 

4.将工程的Bundle Identifier改为自己定义的名字。

 

 

等待几秒钟之后会自动创建真机调试证书文件。此时运行程序,在程序跑起来之后,点击手机里面的通用->描述文件与设备管理->信任自己的证书。这样程序就可以完美运行了。
 
 

上面说的情况是此工程项目没有开启Push Notifications和In-App Purchase的情况下。

5.在项目开启Push Notifications或In-App Purchase的情况下,完成第1-4步之后仍然报错。

 
 
The 'In-App Purchase' feature is only available to users enrolled in Apple Developer Program. Please visit 
https://developer.apple.com/programs/ to enroll.
No profiles for 'com.cloud888' were found
Xcode couldn't find a provisioning profile matching 'com.cloud888'.

 

 

此时需要关闭工程的In-App Purchase功能,若直接到Capabilities中关闭,将In-App Purchase置为OFF,事实上是没有效果的,因为当前选的证书是自己的个人免费证书,是没有In-App Purchase功能的(在Capabilities中找不到这个选项),进而并不能真正关闭。
 
 

 

需要将Automatically manager signing钩去掉,并将team选为公司的证书,$99的证书才能正常关闭。此时仍然报错。信息如下:
 
 
 
 
The 'Apple Push Notification' feature is only available to users enrolled in Apple Developer Program. Please visit 
https://developer.apple.com/programs/ to enroll.
No profiles for 'com.cloud888' were found
Xcode couldn't find a provisioning profile matching 'com.cloud888'.

 

 

此时需要关闭工程的Push Notifications功能。同理,若直接去Capabilities中关闭,将Push Notifications置为OFF,事实上是没有效果的,因为当前选的证书是自己的个人免费证书,是没有Push Notifications推送功能(在Capabilities中找不到这个选项)的,进而并不能真正的关闭。需要将Automatically manager signing钩去掉,并将team选为公司的证书,$99的证书才能正常关闭。
 
 

自动生成真机调试证书的过程可能会要几十秒,致此才能完美运行。

 
posted @ 2018-03-26 14:14  Holyday  阅读(494)  评论(0编辑  收藏  举报