# Xcode exit code 65 / exit code 66 / raw-xcodebuild-output.log

**URL:** <https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813>\
**Category:** Builds\
**Created:** [February 16, 2017, 9:18am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813 "2017-02-16T09:18:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 16, 2017, 9:18am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/1 "2017-02-16T09:18:11Z")

</div>

If you get an exit code 65 error in any of the Xcode steps, something like:

```auto
e[34;1mRunning the tests...e[0m
$ set -o pipefail && env "NSUnbufferedIO=YES" xcodebuild "-workspace" "MyApp.xcworkspace" "-scheme" "MyScheme" "build" "test" "-destination" "platform=iOS Simulator,name=iPhone 6s Plus,OS=latest" | xcpretty "--color" "--report" "html" "--output" "/Users/vagrant/deploy/xcode-test-results-MyScheme.html"

e[33;1mxcode test exit code: 65e[0m
e[31;1mxcode test failed, error: exit status 65e[0m
e[33;1mIf you can't find the reason of the error in the log, please check the raw-xcodebuild-output.log
The log file is stored in $BITRISE_DEPLOY_DIR, and its full path
is available in the $BITRISE_XCODE_RAW_TEST_RESULT_TEXT_PATH environment variablee[0m

```

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 16, 2017, 9:23am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/2 "2017-02-16T09:23:03Z")

</div>

The solution for these Xcode `exit code: 65` issues is to check the `raw-xcodebuild-output.log`, which is mentioned in the log.

## How can I get this `raw-xcodebuild-output.log` file?

The easiest solution is to make sure that you have the **Deploy to [Bitrise.io](http://Bitrise.io)** step in your workflow, anywhere after the Xcode step. With the default configuration of the **Deploy to [Bitrise.io](http://Bitrise.io)** step it will collect all the files from the `BITRISE_DEPLOY_DIR` and attach the files to the build, and the Xcode steps save this `raw-xcodebuild-output.log` into that deploy dir.

## Where can I find this `raw-xcodebuild-output.log` file on the build’s page?

1. open the **build’s page** on [bitrise.io](https://www.bitrise.io)
2. you can find all the attached files / artifacts in the **Apps & Artifacts** section, below the build information and above the build log sections.

 ![](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/1X/c39bc509d73ee4975e930b8db59593e875d179d7.png)

On the artifacts which support “inline preview” just click the “eye” icon on the right side, and that artifact (e.g. `raw-xcodebuild-output.log`) will be shown right on the web UI.

Artifacts which don’t support inline preview (e.g. ZIP files) can be simply downloaded by clicking the download button.

---

<div class="post-metadata">

**Author:** ![tibs](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/tibs/32/772_2.png) [@tibs](https://discuss.bitrise.io/u/tibs)\
**Post date:** [August 26, 2017, 10:38am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/3 "2017-08-26T10:38:05Z")

</div>

> [@viktorbenei](#):
>
> Apps & Artifacts

Hi,

I cannot find this **Apps & Artifacts** section on bitrise.  
Is this answer still available ?

LE: found it, you need to be on the build page 😑

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [September 5, 2017, 9:31am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/4 "2017-09-05T09:31:13Z")

</div>

The location changed a little bit. It’s still on the build’s page (as these are the Apps & Artifacts **of the build** ) but it’s now on a separate tab, instead of just a collapsable section above the log

![Screen_Shot_2017-09-05_at_11_30_08](https://sea2.discourse-cdn.com/flex016/uploads/bitrise/original/1X/9adf8f7d81db5af66d3ddcdbfdd94ee19a2be5b4.png)

---

<div class="post-metadata">

**Author:** ![icma](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@icma](https://discuss.bitrise.io/u/icma)\
**Post date:** [April 7, 2018, 7:15am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/5 "2018-04-07T07:15:52Z")

</div>

Sorry for reviving this, but that tab now simply shows “No apps generated :(” message … How to access the raw logs with the current UI?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [April 7, 2018, 7:18am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/6 "2018-04-07T07:18:47Z")

</div>

@icma please add a (new) **Deploy to [Bitrise.io](http://Bitrise.io)** step anywhere **after** the Xcode step. You either removed that step, or maybe changed the path it should deploy. See above:

> [@viktorbenei](#):
>
> The easiest solution is to make sure that you have the Deploy to [Bitrise.io](http://Bitrise.io) step in your workflow, anywhere after the Xcode step. With the default configuration of the Deploy to [Bitrise.io](http://Bitrise.io) step it will collect all the files from the BITRISE\_DEPLOY\_DIR and attach the files to the build, and the Xcode steps save this raw-xcodebuild-output.log into that deploy dir.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [April 7, 2018, 7:20am UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/7 "2018-04-07T07:20:08Z")

</div>

If that wouldn’t help please share the related build’s [bitrise.io](http://bitrise.io) URL, so that we can check its logs & config 😉

---

<div class="post-metadata">

**Author:** ![icma](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@icma](https://discuss.bitrise.io/u/icma)\
**Post date:** [April 7, 2018, 4:35pm UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/8 "2018-04-07T16:35:09Z")

</div>

Thanks for the prompt reply. I checked again, and I may have been looking at builds that failed at different steps. Now that I try to look for that example, I can’t find it. It’s either there, or build has failed on different steps.

I distinctly remember looking at the `65` exit code, and switching to artifacts, and not finding the logs … Well, I hope the probable, which is that it’s a false alarm and I’m mistaken!

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [April 10, 2018, 4:59pm UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/9 "2018-04-10T16:59:05Z")

</div>

Hmm… I’m not aware of any related issue. Anyway, if you’d see that happen please let us know with the related build’s [bitrise.io](http://bitrise.io) URL and we’ll check it right away! 😉

---

<div class="post-metadata">

**Author:** ![rogerluan](https://avatars.discourse-cdn.com/v4/letter/r/5f9b8f/32.png) [@rogerluan](https://discuss.bitrise.io/u/rogerluan)\
**Post date:** [February 19, 2021, 5:58pm UTC](https://discuss.bitrise.io/t/xcode-exit-code-65-exit-code-66-raw-xcodebuild-output-log/813/10 "2021-02-19T17:58:31Z")

</div>

@viktorbenei looks like Xcode Archive will only save xcodebuild raw log output if it errors, or if the output\_tool is xcodebuild. I’d like to visualize in xcpretty but also retain the raw xcodebuild logs. Is this possible?

This is where I checked: [https://github.com/bitrise-steplib/steps-xcode-archive/blob/29cba9b687aaa7565eea34a552ed6def1a86acf7/main.go#L429](https://github.com/bitrise-steplib/steps-xcode-archive/blob/29cba9b687aaa7565eea34a552ed6def1a86acf7/main.go#L429)

The deploy dir doesn’t contain the output log when using xcpretty.

Thanks in advance
