xcodebuild test on Xcode 14: Could not find test host for DoSomethingElseTests: TEST_HOST evaluates - xcodebuild

I'm running the following command to build and test my project:
xcodebuild -sdk iphonesimulator -configuration DoSomethingElse -project DoSomethingElse.xcodeproj -scheme DoSomethingElse -destination "platform=iOS Simulator,name=iPhone 8 Plus" test
But I'm getting this error:
Reason: Could not find test host for DoSomethingElseTests: TEST_HOST evaluates
But I run the unit test using XCode IDE works just fine.
Any of you knows what I'm doing wrong?, or if there is a way around this?
I'll really appreciate your help

Related

How do I fix Something went wrong in #nrwl/run-commands - Command failed: detox build -c ios.sim.retail.debug

I am experiencing an issue with opening an app for the first time
detox[12987] ERROR: [cli.js] Command failed: export EXCLUDED_ARCHS=arm64 && ENVFILE=.env.dev.detox xcodebuild -workspace ./apps/retail-mobile/ios/app.xcworkspace -scheme app -configuration Debug -sdk iphonesimulator -derivedDataPath ./apps/retail-mobile/ios/build -quiet
ERROR: Something went wrong in #nrwl/run-commands - Command failed: detox build -c ios.sim.retail.debug
How do I fix this? I'm totally confused as it was working before.

Error when attempting to run detox test with xcodebuild created .app file

I'm trying to create a .app that I can then reference in my .detoxrc.json file but I'm running into 2 issues.
This is the command I'm using...
xcodebuild -workspace ios/Boomin.xcworkspace -scheme Boomin -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build -UseModernBuildSystem=YES -arch x86_64
The only .app file I can see is created in the ios -> build -> Build -> Products -> Debug-iphonesimulator directory and it's called customer.app. It looks like customer comes from my terminal user account. How do I rename this?
When I try to run detox test --configuration ios I get the following...
detox[19353] ERROR: field CFBundleIdentifier not found inside Info.plist of app binary at /ios/build/Build/Products/Debug-iphonesimulator/customer.app
How do I resolve both these issues?
Thanks,

Xcodebuild calling test but never running

I'm trying to run tests with the xcodebuild command line in this way ("Ink" is my project):
xcodebuild test -target "Ink" -sdk iphonesimulator TEST_AFTER_BUILD=YES "VALID_ARCHS=armv6 armv7 i386" -arch i386
but the command prompt give me the result:
unsupported build action 'test' - ** TEST FAILED **
What command is missing?
I guess that the command You try to run is badly ordered (the action You want to execute should always be at the end), try:
xcodebuild -target "Ink" -sdk iphonesimulator TEST_AFTER_BUILD=YES "VALID_ARCHS=armv6 armv7 i386" -arch i386 clean test
I also suppose it may be simplified to:
xcodebuild -target "Ink" -sdk iphonesimulator clean test
Which version of xcodebuild You use? Prior to 5.0 it was impossible to execute test action from command line.

How can I fix "Symbol not found: _NSURLSessionTransferSizeUnknown" when running tests using Travis that work locally?

The command xctool -workspace Foo.xcworkspace -scheme Foo -sdk macosx -configuration Debug test -test-sdk macosx works locally and all of the tests pass.
Using Travis I get the following error:
Failed to query the list of test cases in the test bundle: dlopen(/Users/travis/Library/Developer/Xcode/DerivedData/Foo-bvxkmfrwzzvtxgaeoosknyzjovjc/Build/Products/Debug/OS X Tests.xctest/Contents/MacOS/OS X Tests, 2): Symbol not found: _NSURLSessionTransferSizeUnknown
Referenced from: /Users/travis/Library/Developer/Xcode/DerivedData/Foo-bvxkmfrwzzvtxgaeoosknyzjovjc/Build/Products/Debug/OS X Tests.xctest/Contents/MacOS/OS X Tests
Expected in: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
in /Users/travis/Library/Developer/Xcode/DerivedData/Foo-bvxkmfrwzzvtxgaeoosknyzjovjc/Build/Products/Debug/OS X Tests.xctest/Contents/MacOS/OS X Tests
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
** TEST FAILED: 0 passed, 0 failed, 0 errored, 0 total ** (21121 ms)
The command "xctool -workspace Foo.xcworkspace -scheme Foo -sdk macosx -configuration Debug test -test-sdk macosx" exited with 1.
My .travis.yml file is as follows:
language: objective-c
before_install:
- gem install cocoapods --no-ri --no-rdoc --no-document --quiet
- brew update
- brew uninstall xctool
- brew install xctool
script:
- xctool -workspace Foo.xcworkspace -scheme Foo -sdk macosx -configuration Debug test -test-sdk macosx
Why does this happen and how can I fix this?
Travis does not currently support Mavericks which is the root cause of the problem.
Support for 10.9 is being tracked in this issue on GitHub.

GHUnit CLI Build: Availability.h errors

I am trying to do a command line build of a GHUnit target which builds fine inside Xcode. I am running the following command to build:
GHUNIT_CLI=1 xcodebuild -target
BasicBrowserUnitTest -configuration
Debug -sdk iphonesimulator4.0 build
It gets along pretty nice, until it finds an error in Availability.h, an SDK header:
/Xcode4
GM/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/usr/include/AvailabilityInternal.h:56:42:
error: operator '<' has no left
operand
Obviously, I haven't made any changes to Apple's stuff, why am I getting this error and how do I fix it?
The problem is that I wasn't specifying the correct SDK version:
GHUNIT_CLI=1 xcodebuild -target
BasicBrowserUnitTest -configuration
Debug -sdk iphonesimulator4.0 build
Needed to be:
GHUNIT_CLI=1 xcodebuild -target
BasicBrowserUnitTest -configuration
Debug -sdk iphonesimulator4.3
build
Or in this case, the latest SDK version.