# Ensure command-line tools (or xcode) are installed on OS X?

**URL:** <https://forum.ansible.com/t/ensure-command-line-tools-or-xcode-are-installed-on-os-x/17227>\
**Category:** Ansible Project\
**Created:** [January 9, 2015, 6:23am UTC](https://forum.ansible.com/t/ensure-command-line-tools-or-xcode-are-installed-on-os-x/17227 "2015-01-09T06:23:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bret\_Comnes](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@Bret\_Comnes](https://forum.ansible.com/u/Bret_Comnes)\
**Post date:** [January 9, 2015, 6:23am UTC](https://forum.ansible.com/t/ensure-command-line-tools-or-xcode-are-installed-on-os-x/17227/1 "2015-01-09T06:23:41Z")

</div>

I was wondering what the best way to ensure that the apple command-line tools (or xcode) are installed on a OS X host. Does anyone know of a good way or of a pattern to ensure that this is the case with ansible?

---

<div class="post-metadata">

**Author:** ![Baraa\_Basata1](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@Baraa\_Basata1](https://forum.ansible.com/u/Baraa_Basata1)\
**Post date:** [January 12, 2015, 12:10am UTC](https://forum.ansible.com/t/ensure-command-line-tools-or-xcode-are-installed-on-os-x/17227/2 "2015-01-12T00:10:10Z")

</div>

I check the exit code of running “xcodebuild --help”. I don’t have an Ansible example to offer, but I hope this helps.

-Baraa
