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?

Thanks,
Gil

0
3 comments
Avatar
Permanently deleted user

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.

0

Currently it is impossible to adjust the timeout. I've created an issue on our tracker: http://youtrack.jetbrains.com/issue/OC-9127

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/Xcode.app/Contents/Developer/usr/bin. Rename the original xcodebuild to _xcodebuild, and put this script instead:

#!/usr/bin/python
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)


call(args)

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

0

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/Xcode_8.2.1-P.app/Contents/Developer/usr/bin/xcodebuild", 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?

0

Please sign in to leave a comment.