方法一:
1.Product -> Archive生成.xarchive文件
2.使用命令,将.xarchive文件转为.ipa文件
xcodebuild -exportArchive -exportFormat ipa -archivePath {PATH}/MyApp.xcarchive -exportPath ~/Desktop/MyApp.ipa
更新
Xcode升级到8.3.3以后,去掉了exportFormat参数,增加了exportOptionsPlist参数,命令更改为
xcodebuild -exportArchive -archivePath {PATH}/MyApp.xcarchive -exportPath {PATH}/MyApp.ipa -exportOptionsPlist {PATH}/ipa.plist
其中,plist文件可参考如下方式写
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>development</string>
</dict>
</plist>
方法二:
1.Create Xarchieve file by using Xcode, click product->archive
2.first right click on xarchieve file-> show in finder
3.again right click on xarchieve file-> show package contents
4.Then open folder products->applications, here you get the your application file
5.Now, Drag and drop this one to itunes store’s app directory(find apps drop down menu at right top corner of itunes store). This will automatically converts archieve file to ipa file. (Here, you can also do this -> drag and drop .app file anywhere in itunestore, once it get processed, search it back from search box).
6.then again right click on it and ->show in finder, this will show your ipa file. Now you can give this one to any user