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

How to use bitrise to test macOS app with fastlane #5

Merged
merged 7 commits into from Oct 9, 2017
Merged

Conversation

mzp
Copy link
Owner

@mzp mzp commented Oct 9, 2017

bitrise.io supports macOS app, not only iOS. But there is less document than iOS world, especially about signing.

πŸ“š Related documentation

πŸ’» My environments

  • Xcode 9
  • macOS 10.12
  • Run XCTest with fastlane scan

😰 Signing problem

fastlane scan with default settings is success at local machine, but it is failed at bitrise.io by signing certificate error:

❌  error: No signing certificate "Mac Development" found: No "Mac Development" signing certificate matching team ID "XXXX" with a private key was found. (in target 'Tests')

This problem happens because Mac Developer certificate is tied to your machine, not CI machine.

πŸ˜„ Solution

Use Developer ID Application certification explicitly to solve this problem.

Step 1: Use Developer ID Application

At general tab of project setting, disable automatic signing and use "Developer ID Application" for release:

screen shot 2017-10-09 at 2 08 56

Use same setting for Tests target.

Step 2: Upload private key to bitrise

Export "Developer ID Application" certificate from Xcode accounts preference:

screen shot 2017-10-09 at 2 11 09

Set strong enough password:

screen shot 2017-10-09 at 2 12 48

Upload exported p12 file to bitrise in the app's Workflow Editor, and set password:

screen shot 2017-10-09 at 2 14 12

Step 3: Run test with release configuration

Run tests with release configuration.

If you uses fastlane scan, write Scanfile like:

workspace 'EmojiIM.xcworkspace'
scheme 'EmojiIM'
configuration 'Release'

Step 4: Setup bitrise to use fastlane

---
format_version: '4'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: macos
trigger_map:
- push_branch: "*"
  workflow: primary
- pull_request_source_branch: "*"
  workflow: primary
workflows:
  primary:
    steps:
    - activate-ssh-key: {}
    - git-clone: {}
    - cache-pull: {}
    - certificate-and-profile-installer: {}
    - fastlane:
        inputs:
        - lane: test
    - deploy-to-bitrise-io: {}
    - cache-push: {}
app:
  envs:
  - opts:
      is_expand: false
    BITRISE_PROJECT_PATH: EmojiIM.xcworkspace
  - opts:
      is_expand: false
    BITRISE_SCHEME: EmojiIM

🏷 Protip

Workaround: "code object is not signed at all" error

Sometime, codesign command failed with "code object is not signed at all" error.

I don't understand detail, but Stack Overflow recommends to use --deep flags and solve this.

screen shot 2017-10-09 at 2 24 42

Enable automatic signing at development

Set Code signing style at build settings:

screen shot 2017-10-09 at 2 26 55

@mzp mzp changed the title Using bitrise to build macOS app Using bitrise to test macOS app with fastlane Oct 9, 2017
@mzp mzp added the article label Oct 9, 2017
@mzp mzp changed the title Using bitrise to test macOS app with fastlane Use bitrise to test macOS app with fastlane Oct 9, 2017
@mzp mzp changed the title Use bitrise to test macOS app with fastlane How to use bitrise to test macOS app with fastlane Oct 9, 2017
@mzp mzp merged commit 392a944 into master Oct 9, 2017
@mzp mzp deleted the bitrise branch October 9, 2017 02:37
@mzp mzp mentioned this pull request Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant