问题
I am a lazy iOS developer working in a large iOS project. I have already applied many optimisations to reduce my project build time but each builds taking more than 10~12 mins. I start building and by the time builds finished sometimes, I fall asleep on my desk. Is there any way to integrate any voice/ring alert with the xcode build system so that when build is succeeded or failed I will be notified immediately for my next action.
回答1:
You can
Add “Run Script” phase of your project.
Type in
afplay
followed by some sound file on your computer. You can use one of the really short sounds found in the/System/Library/Sounds
directory, for example:
Just pick any sound file you’d like (other than something protected by DRM, most likely) and add afplay
of that file as the last step in a “Run Script” phase. You probably want something long enough to get your attention, but not so long as to be annoying. Maybe consider getting some “ringtones” (e.g. m4r files or the like) and trying those out.
回答2:
Finally I got an option to set up success and failure sound clip from
Preferences > Behaviours
来源:https://stackoverflow.com/questions/59498121/how-to-setup-an-alarm-on-xcode-build-finish