xcode - 出现编译错误时让 xcode 播放声音

标签 xcode

我遇到了 Xcode 3 的终端单行程序,每次我尝试编译并遇到错误时,它都会播放 Inception "BWAAAAHNN"声音。它可以很好地阻止错误,因为没有人愿意永远被这种声音吓到。

有人知道这是怎么做到的吗?它还能在 Xcode 4 中工作吗?

编辑:感谢贾斯汀的提示(首选项> 行为> 构建失败> 播放声音)我解决了这个问题:

curl http://www.freesound.org/data/previews/73/73581_634166-lq.mp3 -o /Developer/Extras/trombone.mp3
defaults write com.apple.dt.Xcode "Xcode.AlertEvents.4_1" -dict-add "Xcode.AlertEvent.BuildFails" '<dict><key>Xcode.Alert.Sound</key><dict><key>enabled</key><true/><key>soundPath</key><string>/Developer/Extras/trombone.mp3</string></dict></dict>'
defaults write com.apple.dt.Xcode "Xcode.AlertEvents" -dict-add "Xcode.AlertEvent.BuildFails" '<dict><key>Xcode.Alert.Sound</key><dict><key>enabled</key><true/><key>soundPath</key><string>/Developer/Extras/trombone.mp3</string></dict></dict>'

它比 1 行多一点,但我不确定是否需要第三行(Xcode 似乎保留了两个版本的行为设置?)。
另外,这次我选择了不同的声音。 :)

最佳答案

在 Xcode 4 中,它们是行为。

首选项 > 行为 > 构建失败 > 播放声音

或 Build 产生新问题

至于烦人,一个行为也可以跟你说话,或者打开和关闭你项目的 View 等等,你可以把它们组合起来O_O。

关于xcode - 出现编译错误时让 xcode 播放声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8767415/

相关文章:

objective-c - 无法链接两个tableView的数据源

iOS swift : Pushing two view controllers when app launched from push notification

ios - "Search Paths"中缺少 "Build Settings"

ios - 如何以编程方式禁用 Facebook 无代码事件?

ios - XCode 预处理器宏 #if 仍然包含与符号定义为 0 相反的代码

objective-c - 在 OS X 上创建和使用静态库

ios - 验证错误 : The bundle contains disallowed nested bundles

iphone - 如何在 Xcode 4.2 上测试 iOS 5.0 应用程序?

iphone - xcode中的文件夹结构与finder中的文件夹结构

ios - xcode 5 UITableView 总是填满屏幕的整个长度