sersoft-gmbh / xcodebuild-action

A GitHub action that runs xcodebuild
Apache License 2.0
94 stars 9 forks source link

Build and locate XCUITest Suite for device #149

Open emin-grbo opened 1 year ago

emin-grbo commented 1 year ago

Hi! Trying to build and ZIP the XCUI test suite, but no matter which approach I take, I have issues retrieving the file.

I was only ever able to get the file usually located in DerivedData/**/Build/Products/Debug-iphonesimulator/ never the one which I actually need DerivedData/**/Build/Products/Debug-iphoneos/

In other words, my build target needs to be for generic/device.

Is there a setting I am missing where a runner would be built for a device? Thank you!

## BUILD AND SAVE XCTEST RUNNER ====================================================
    - name: Build XCUITest via action
      uses: sersoft-gmbh/xcodebuild-action@v2.0.1
      with:
       workspace: TARGET.xcworkspace
       scheme: TARGET-UITests
       destination: generic/platform=iOS
       action: build-for-testing
       cloned-source-packages-path: "SourcePackages"
       allow-provisioning-updates: true

    - name: Save XCUI
      uses: actions/upload-artifact@v3
      with:
        name: TARGET-UITests-Runner.app
        path: TARGET-UITests-Runner.app

    - name: Zip Runner
      uses: vimtor/action-zip@v1
      with:
        files: TARGET-UITests-Runner.app
        dest: TARGET-UITests-Runner.zip
ffried commented 12 months ago

@emin-grbo Do you have an xcodebuild command that does what you want? If so, how does it differ from the one this action generates (it's printed in the logs before actually running it)?

emin-grbo commented 12 months ago

Thank you for responding @ffried ! This is the default one I was using, but I had issues with it as well and assumed I did something wrong with my initial setup.

run: xcodebuild -workspace ./TARGET.xcworkspace -scheme TARGET-UITests -clonedSourcePackagesDirPath SourcePackages -allowProvisioningUpdates -resolvePackageDependencies -destination generic/platform=iOS build-for-testing

Good note about checking the logs and comparing them. Will do that next 🙌