Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode command line test execution issues

I'm in a strange situation where I can get xctool to run my test but I cant figure out the equivalent command line to get xcodebuild and/or fastlane scan to run my tests. I have an iPad only application with a single scheme and two targets (otto and ottoTests)

Working XCTool Commandline

xctool -scheme otto \
       -sdk iphonesimulator \
        CODE_SIGN_IDENTITY=""\
        CODE_SIGNING_REQUIRED=NO \
       -reporter pretty\
       -reporter junit:./test-reports/otto.xml\
        build test

Xcodebuild - fail

xcodebuild -sdk iphonesimulator \
           -scheme otto \
      test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

I get this error that

A build only device cannot be used to run this target

enter image description here

So I'm kind of at a loss here exactly what is different between xcodebuild and whatever xctool is running.

like image 871
Jeef Avatar asked Nov 22 '25 06:11

Jeef


1 Answers

AFAICS, you are missing the -destination argument in the xcodebuild command. Refer to this tutorial for sample code.

like image 104
Arthur Gevorkyan Avatar answered Nov 23 '25 22:11

Arthur Gevorkyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!