Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codesigndoc does not find scheme with UITests enabled #126

Open
ehyche opened this issue Sep 28, 2020 · 14 comments
Open

codesigndoc does not find scheme with UITests enabled #126

ehyche opened this issue Sep 28, 2020 · 14 comments

Comments

@ehyche
Copy link

ehyche commented Sep 28, 2020

In our iOS app, I attempted to use codesigndoc to export the code-signing files for running UI tests. The Terminal.app output is included below. There IS a scheme present that has UITests enabled:

Screen Shot 2020-09-28 at 11 08 21 AM

Screen Shot 2020-09-28 at 11 09 47 AM

But codesigndoc does not identify the CoachUITests scheme.

I WAS able to run a build-for-test run in Xcode successfully.

So here is the run of codesigndoc:

ehyche in ~/src/github/noom/coach-ios (develop) > bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap-xcode-uitests.sh)"
 => Creating a temporary directory for codesigndoc ...
 => Downloading version: 2.4.1
 => Downloading codesigndoc from (https://github.com/bitrise-io/codesigndoc/releases/download/2.4.1/codesigndoc-Darwin-x86_64) to (/var/folders/lr/bztrcn1x42l5q8fwwyh2422c0000gp/T/codesigndocXXXXXX.qViPbywf/codesigndoc) ...
################################################################################################################# 100.0%################################################################################################################# 100.0%
 => Making it executable ...
 => codesigndoc version: 2.4.1
 => Running codesigndoc scan ...


Xcode (xcodebuild) version: Xcode 11.7 (Build version 11E801a)

Scan the directory for project files
You can specify the Xcode project/workscape file to scan with the --file flag.
Found one project file: Noom.xcworkspace.

🔦  Scanning Schemes ...
Error: no schemes found with UITest target enabled:

------------------------------
First of all, check the selected scheme in Xcode:
- Make sure, you have enabled at least one UITest target for test run in the selected scheme's build option.
- Make sure that the UITest target is added (and enabled) in the selected scheme's test option.

After this please make sure that you can run build-for-testing for your app from Xcode.
codesigndoc only works if you can run build-for-testing for your app from Xcode.
For this run a clean in your Xcode, after that, run a build-for-testing for your app in Xcode.
If you can, and you get a valid *-Runner.app file, please create an issue on GitHub at: https://github.com/bitrise-io/codesigndoc/issues
with as many details & logs as you can share!
------------------------------

So then I did the following:

  1. Opened Xcode and selected the CoachUITests scheme shown above
  2. Did a Clean
  3. Deleted my Derived Data folder
  4. Ran Product/Build For Testing. That completed successfully.
  5. Then I looked in the Derived Data folder, and was able to find the -Runner.app.
ehyche in ~/src/github/noom/coach-ios (develop) > cd ~/Library/Developer 
ehyche in ~/Library/Developer  > find . -name "*-Runner.app"
./Xcode/DerivedData/Noom-durciaqeajcieegapeqmlkivmlux/Build/Products/Staging-iphoneos/CoachUITests-Runner.app
./CoreSimulator/Devices/26C6FAB9-CDC3-4E85-BEC0-3A5A41C9E68B/data/Containers/Bundle/Application/79124390-9362-483D-82E2-1C122BD56890/CoachUITests-Runner.app

So as you can see, the CoachUITests-Runner.app was created successfully.

@chaitanyatanna-bitrise
Copy link

Hi @ehyche
I am sorry to hear that you are having issues with the code signing.
Can you please make sure that the scheme is shared?
And if you are using cocoapods, the scheme needs to be shared with the workspace, not just the project.

Thanks
Chaitanya

@ehyche
Copy link
Author

ehyche commented Sep 28, 2020

Yes, it is shared. If you look in the top screenshot, just to the right of the "Manage Schemes" button, you will see that the "Shared" button is checked.

In regards to your question "the scheme needs to be shared with the workspace, not just the project.": How do I tell/change if the scheme is shared with the workspace and/or project (other than the "Shared" checkbox above)?

@ehyche
Copy link
Author

ehyche commented Sep 28, 2020

@chaitanyatanna-bitrise : I checked where the CoachUITests.xcscheme file was located. Previously, it was located here:

./Coach_iOS/Coach.xcodeproj/xcshareddata/xcschemes

So I did the following:

  1. Went to "Manage Schemes..."
  2. Found the "CoachUITests" scheme
  3. Changed the Container from "Coach project" to "Noom Workspace"
  4. Made sure the "Shared" checkbox was still checked.

Now the CoachUITests.xcscheme file is now located here:

./Noom.xcworkspace/xcshareddata/xcschemes/CoachUITests.xcscheme

That is, inside the workspace's xcshareddata folder.

But still, the codesigndoc run fails to find it:

ehyche in ~/src/github/noom/coach-ios (ehyche/AT2-1011-move-CoachUITests-scheme) > bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap-xcode-uitests.sh)"
 => Creating a temporary directory for codesigndoc ...
 => Downloading version: 2.4.1
 => Downloading codesigndoc from (https://github.com/bitrise-io/codesigndoc/releases/download/2.4.1/codesigndoc-Darwin-x86_64) to (/var/folders/lr/bztrcn1x42l5q8fwwyh2422c0000gp/T/codesigndocXXXXXX.JbShw97z/codesigndoc) ...
################################################################################################################# 100.0%################################################################################################################# 100.0%
 => Making it executable ...
 => codesigndoc version: 2.4.1
 => Running codesigndoc scan ...


Xcode (xcodebuild) version: Xcode 11.7 (Build version 11E801a)

Scan the directory for project files
You can specify the Xcode project/workscape file to scan with the --file flag.
Found one project file: Noom.xcworkspace.

🔦  Scanning Schemes ...
Error: no schemes found with UITest target enabled:

------------------------------
First of all, check the selected scheme in Xcode:
- Make sure, you have enabled at least one UITest target for test run in the selected scheme's build option.
- Make sure that the UITest target is added (and enabled) in the selected scheme's test option.

After this please make sure that you can run build-for-testing for your app from Xcode.
codesigndoc only works if you can run build-for-testing for your app from Xcode.
For this run a clean in your Xcode, after that, run a build-for-testing for your app in Xcode.
If you can, and you get a valid *-Runner.app file, please create an issue on GitHub at: https://github.com/bitrise-io/codesigndoc/issues
with as many details & logs as you can share!
------------------------------

I verified that after the change to move the CoachUITests.xcscheme file to the workspace's xcshareddata folder, that I can still successfully run the build-and-test.

@ehyche
Copy link
Author

ehyche commented Sep 28, 2020

Here is the screenshot of the "Manage Schemes..." dialog:

Screen Shot 2020-09-28 at 3 53 26 PM

@chaitanyatanna-bitrise
Copy link

Hi @ehyche
You would also need to check that the changes are reflected in the xcschemes file and that file is correctly committed to the repository.
https://stackoverflow.com/questions/14368938/xcodebuild-says-does-not-contain-scheme

@ehyche
Copy link
Author

ehyche commented Sep 29, 2020

@chaitanyatanna-bitrise : I have verified that the CoachUITests.xcscheme file is correctly committed to the repository in Noom.xcworkspace/xcshareddata/xcschemes.

When you say "the changes are reflected in the xcschemes file", what changes are you referring to?

@mjones-droid
Copy link

Hey @ehyche!

I'd be happy to dig into this further for you. I need the following:

1.) Please enable support access for your account.

2.) Please send me the link to a recently failed build.

3.) I need your written permission to create a debug workflow on your account and connect to your build via remote access. Note that this will allow me to view your source code.

Thanks,

Matthew
Senior Customer Engineer

@tobitech
Copy link

@ehyche Did you manage to solve this issue, I'm experiencing the same. I've tried everything and I keep getting Error: no schemes found with UITest target enabled:

@cassio-rossi
Copy link

Is this issue solved? Any clue? I'm having the same problem (and I'm not using workspace as I'm not using Cocoapods).

@karapigeon
Copy link

As @mjones-droid requested, can you provide a build link and enable support access so we can take a look and investigate further?

@cassio-rossi
Copy link

I don't understand why you need access to our account if the problem is related to a script being executed locally on our machines to generate the certificates to allow Xcode to build the project. So, if we can't generate the certificates, there is no failed build to look at.
The problem is on the script bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap-xcode-uitests.sh)"
The script bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-tools/codesigndoc/master/_scripts/install_wrap.sh)" is working fine.
The workaround I did was to rename the bundle Id of my UI Test target and generate the certificates.

@bitce
Copy link

bitce commented Feb 1, 2021

Hi everyone! Sorry for the confusion earlier. In case anyone who is experiencing this issue is able to send us a project file at support@bitrise.io that would be really helpful in debugging this case.

@tijojose27
Copy link

Having the same problem...was this ever resolved

@Roland-Bak
Copy link

Roland-Bak commented Jun 1, 2021

Hey there @tijojose27 , could you please submit a ticket to us on support.bitrise.io/hc or write us an email to support@bitrise.io? Please send us the log file or the URL of the related build and also enable Support Access on the Settings tab of the app ( https://devcenter.bitrise.io/troubleshooting/enabling-bitrise-support-user/ ) so that we can take a more in-depth look. 🙂

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

No branches or pull requests

9 participants