Increasing destination-timeout argument in xcodebuild command?

I'm getting a timeout when trying to build from appcode:

I get the same error when lauching xcodebuild from the command line using the same arguments as appcode.

On the command line, Increasing the value of -destination-timeout from 2 to 3 solves the problem.  Ideas on how to do this in appcode, or sidestep the problem?


Comment actions Permalink

Oops - forgot to paste the error:

xcodebuild: error: Was unable to find a destination matching the arguments to the -destination flag:
    The requested device could not be found because no available devices matched the request.

The "-destination" flag lists a valid device ID that works when I supply a longer timeout period via -destination-timeout.

Comment actions Permalink

Currently it is impossible to adjust the timeout. I've created an issue on our tracker:

For the time being, you can try to use a wrapper around xcodebuild that replaces the value before calling xcodebuild. The binary is located in /Applications/ Rename the original xcodebuild to _xcodebuild, and put this script instead:

import sys
import os
from subprocess import call

args = sys.argv[1:]
argsDict = dict(args[i:i+2] for i in range(0, len(args), 2))
argsDict['-destination-timeout'] = '3'

args = [a for item in argsDict.items() for a in item]
xcodebuild = os.path.dirname(__file__) + '/_xcodebuild'
args.insert(0, xcodebuild)


Remember to set the executable flag (chmod +x xcodebuild).

Comment actions Permalink

When I try to use this script, I get the following error in AppCode 2017.1.1:

Error:Traceback (most recent call last):
Error:File "/Users/n648892/Applications/", line 10, in <module>
Error:argsDict = dict(args[i:i+2] for i in range(0, len(args), 2))
Error:ValueError: dictionary update sequence element #7 has length 1; 2 is required
Error:Build failed with 4 errors and 0 warnings in 366ms

If I run the script from terminal, it works fine.

Any thoughts as to what the problem might be?


Please sign in to leave a comment.