Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

pxctest - build and run-tests issue #8

Open
cliren opened this issue Dec 12, 2016 · 6 comments
Open

pxctest - build and run-tests issue #8

cliren opened this issue Dec 12, 2016 · 6 comments

Comments

@cliren
Copy link

cliren commented Dec 12, 2016

Any idea what's going on here? The build succeeded but it didn't generate $PWD/build/Products/. xctestrun file. But an .xctest run file is generated at Build/Intermediates/CodeCoverage/Products/MyApp_iphonesimulator10.1-x86_64.xctestrun, when run this location getting an error as shown below.

`
Xcode 8.1
Build version 8B62

xcodebuild
-IDEBuildLocationStyle=Custom
-IDECustomBuildLocationType=Absolute
-IDECustomBuildProductsPath="$PWD/build/Products"
-scheme 'MyApp'
-workspace 'MyApp.xcworkspace'
-destination 'platform=iOS Simulator,name=iPhone 5,OS=10.1'
build-for-testing

pxctest \

run-tests
--destination 'name=iPhone 5,os=iOS 10.1'
--testrun Build/Intermediates/CodeCoverage/Products/MyAppUnitTests_iphonesimulator10.1-x86_64.xctestrun

Error Domain=com.facebook.XCTestBootstrap Code=0 "Failed to find test host application" UserInfo={NSLocalizedDescription=Failed to find test host application, NSUnderlyingError=0x7f845045a1d0 {Error Domain=com.facebook.FBControlCore Code=0 "Could not obtain Bundle ID for app at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest" UserInfo={NSLocalizedDescription=Could not obtain Bundle ID for app at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest}}}
`

@okanerdogan09
Copy link

it is same for me
when i remove _ build-for-testing_ i see a build/Products file is created.But still could'nt manage to create a .xctestrun file.
And in PhaseScriptExecution part I see > Debug Warning: Could not remove unsupported architecture in build phase. This is the only warning i can see

xcodebuild \ -IDEBuildLocationStyle=Custom \ -IDECustomBuildLocationType=Absolute \ -IDECustomBuildProductsPath="$PWD/build/Products" \ -scheme 'Staging' \ -workspace 'lng.xcworkspace' \ -destination 'platform=iOS Simulator,name=iPhone 5,OS=10.1'

@plu
Copy link
Owner

plu commented Dec 13, 2016

The build succeeded but it didn't generate $PWD/build/Products/. xctestrun file.

All the projects I could get my hand on were generating the xctestrun file in the given directory once I passed all the three -IDE... options. You're using the correct options. I assume the products are not put into that folder because of some build setting in your project. Which one that might be, I don't know, sorry.

Failed to find test host application

It looks like you're trying to run some test target that does not have a Host Application. Unfortunately this is not supported currently.

screen shot 2016-12-13 at 03 54 48

@atineoSE
Copy link

atineoSE commented Jan 9, 2017

I'm facing the same problem: the xctestrun file is not being generated, despite following the instructions.

This is a complex project with several targets and schemes and don't know where to start looking. Any tips?

@ollieatkinson
Copy link
Contributor

ollieatkinson commented Jan 9, 2017

if you have code coverage enabled, the xctestrun gets placed in the derived data (despite you asking it to).

e.g.

      xcodebuild \
            -derivedDataPath /tmp/derivedData \
            -scheme 'ExampleScheme' \
            -workspace 'Example.xcworkspace' \
            -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.0' \
            build-for-testing"

Then check /tmp/derivedData/Build/Intermediates/CodeCoverage/Products/.

specifying your own derived data path and extracting it from there seems OK.

@atineoSE
Copy link

You are right @ollieatkinson. Many thanks.

I do have code coverage enabled. Using the derived data custom path my xctestrun file is located at
/tmp/derivedData/Build/Intermediates/CodeCoverage/Products/Mytarget_iphonesimulator10.2-x86_64.xctestrun

Which has helped me realize that I can find the file just as fine without using the -IDEx flags nor the -derivedDataPath flag at:
/Users/MyUser/Library/Developer/Xcode/DerivedData/MyApp-xxx/Build/Intermediates/CodeCoverage/Products/MyTarget_iphonesimulator10.2-x86_64.xctestrun

where MyApp-xxx is the name of the app followed by a long string of letters.

(using Xcode 8.2.1)

@plu
Copy link
Owner

plu commented Jan 10, 2017

Cool that you found a solution. Would be great to have this in the readme, seems to be a common pitfall you can hit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants