2013-06-18 54 views
8

我在Xcode中有脚本,它在归档操作结束时自动运行。它正在签署并将构建提交给TestFlight服务。问题是上传需要很长时间,我看不到任何进展。cURL - 通知上传进度

作为一个通知它正在使用苹果脚本通知:

notify() { 
    /usr/bin/osascript -e "display notification \"$1\" with title \"Xcode\"" 
} 
notify "Uploading to TestFlight" 

卷曲上传都是在这里完成:

/usr/bin/curl "http://testflightapp.com/api/builds.json" \ 
-F [email protected]"/tmp/${PRODUCT_NAME}.ipa" \ 
-F [email protected]"/tmp/${PRODUCT_NAME}.dSYM.zip" \ 
-F api_token="${API_TOKEN}" \ 
-F team_token="${TEAM_TOKEN}" \ 
-F notes="Build uploaded automatically from Xcode." 

我会很高兴,如果我能看到大约10,20,等等类似的消息上传过程的百分比。

下面是完整的脚本:https://gist.github.com/ealeksandrov/5808692

+0

[cURL:如何在上传时显示进度信息?](https://stackoverflow.com/questions/9973056/curl-how-to-display-progress-information-while-uploading) – slm

回答

10

某处重定向输出和进度条会显示出来。它在你的情况下被关闭的原因是你已经要求curl将下载的数据发送到标准输出,然后它自动关闭进度计,不会弄乱输出。

因此,在shell中使用>重定向或使用卷曲的-o(小写字母o)或-O(大写字母o)选项之一。

+1

示例Mac:> dev/null –