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

[pilot][upload_to_testflight] add Mac support #19296

Merged
merged 2 commits into from Aug 27, 2021

Conversation

joshdholtz
Copy link
Member

@joshdholtz joshdholtz commented Aug 26, 2021

Motivation and Context

Apple opened up TestFlight to Mac apps on August 24, 2021

Description

  • Pilot
    • Added new option for pkg
    • Removed ios as default option on app_platform option
  • BuildWatcher
    • Turns out that builds have multiple processing states (1 on builds and 2 on buildBetaDetails)
    • The processings are independent of each other but should finish at the same time
    • Previously we only wait for the build processing but Mac builds are slower on the buildBetaDetails processing currently
    • Added an option (that pilot uses) to wait for all 3 processing status
  • Spaceship
    • Added new helpder function on buildBetaDetails called processing? that will return true when internal and external states are done processing

Testing Steps

Update Gemfile and run bundle install, bundle update fastlane, or bundle update

gem "fastlane", :git => "https://github.com/fastlane/fastlane.git", :branch => "joshdholtz-pilot-for-mac"

Copy link
Member

@crazymanish crazymanish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very good to me 🚀 also those pkg unit tests in BuildManager ❤️ 🔥

@@ -108,7 +118,8 @@ def wait_for_build_processing_to_be_complete(return_when_build_appears = false)
timeout_duration: config[:wait_processing_timeout_duration],
return_when_build_appears: return_when_build_appears,
return_spaceship_testflight_build: false,
select_latest: config[:distribute_only]
select_latest: config[:distribute_only],
wait_for_build_beta_detail_processing: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BuildWatcher is used for build uploads or in submit_for_review.
Could you explain why when return_when_build_appears = false we want to always wait for buildBetaDetails processing when we upload builds but when wesubmit_for_review we skip waiting for buildBetaDetails processing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucgrabowski By submit_for_review you mean using deliver, right? A not pilot? buildBetaDetails includes flags for "internal testing state" and "external testing state". Processing the binary for App Store submittal and processing the binary for testing distribution are apparently two different things in App Store Connect

Since pilot deals with testing, the App Store Connect API will give an error if the internal and external testing state are still "processing". Submitting a binary for review does not care about the testing state so these don't need to be watched. IDEALLY they should finish at the same time but they aren't designed to.

Hope that helps 😊

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshdholtz Many thanks for explanation 🚀
That really makes sense :)

@joshdholtz joshdholtz merged commit e8d30e3 into master Aug 27, 2021
@fastlane-bot
Copy link

Hey @joshdholtz 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations! 🎉 This was released as part of fastlane 2.193.0 🚀

@idoodler
Copy link

Hi, thanks for that feature!

I am trying to implement this, the upload works 👍

However I am unable to select the uploaded build in AppStore Connect.

I watched the WWDC session regarding the TestFlight and macOS. They mention, that we must manually create a special provisioning profile if we don't use automatic codesigning.

I am building an Electron app using electron-builder, thus I use manual codesigning. I am unable to find any information on what provisioning profile is necessary.

HI also asked for help in the Apple Developer Forums

Maybe someone here can point me in the right direction.

thx

@uglide
Copy link

uglide commented Nov 3, 2021

Hi @idoodler
Have you found a solution? I faced the same problem and cannot figure out how to fix "Not Available for Testing" status in AppStore Connect.

@idoodler
Copy link

idoodler commented Nov 4, 2021

Hi @idoodler

Have you found a solution? I faced the same problem and cannot figure out how to fix "Not Available for Testing" status in AppStore Connect.

No, not yet:/

@uglide Do you also work with an Electron App?

@tremblay
Copy link
Contributor

Hi, I'm also having trouble with this feature. It seems the build_app gives us a .app as the output, but upload_to_testflight says that the .app "doesn't seem to be a pkg file". Could you give any advice about what settings I may have mixed up?

For reference, here are my calls to build_app and upload_to_testflight (I replaced my actual app name with Name):

def build_mac(configuration, scheme)
  build_app(
    configuration: configuration,
    export_method: "mac-application",
    scheme: scheme,
    include_symbols: true,
    include_bitcode: true,
    export_options: {
      provisioningProfiles: {
        "app.Name" => "Mac AppStore",
        "app.Name.AutoFill" => "Mac AutoFill",
        "app.Name.Safari" => "Mac Safari"
      }
    }
  )
end
upload_to_testflight(
  pkg: "./Name.app",
  app_platform: "osx",
  distribute_external: true,
  groups: ['External Testers'],
  changelog: options[:changelog]
)

@uglide
Copy link

uglide commented Nov 10, 2021

@idoodler I'm packaging Qt app. I found a solution how to successfully upload macOS App to TestFlight. The following attributes should be added to Entitlements.plist:

        <key>com.apple.application-identifier</key>
	<string>XXXXXXX.com.sample.app</string>
	<key>com.apple.developer.team-identifier</key>
	<string>XXXXXXX</string>

In addition, you should supply the app with embedded.provisionprofile which is Mac App Store Distribution Profile.

@idoodler
Copy link

@tremblay I am not using build_app but electron-builder instead

@idoodler
Copy link

idoodler commented Nov 10, 2021

@uglide Thanks, I will try that with todays alpha build. Did you figure that out yourself, or is there a source you found that information?

@idoodler
Copy link

@tremblay I just checked the documentation of fastlane. You may want to use a different export_method, something like app_store or package

@idoodler
Copy link

@uglide No, this did not the trick for me. It still states that the build is not available for TestFlight testing.

@idoodler
Copy link

@uglide I was just checking the embedded.provisionprofile. The entitlements entry has the keys and values you suggest. Did you recreate such a profile, or did you simply use your already existing one?

@uglide
Copy link

uglide commented Nov 11, 2021

@idoodler new one generated after Testflight release.

@fastlane fastlane locked and limited conversation to collaborators Jan 11, 2022
@lacostej lacostej deleted the joshdholtz-pilot-for-mac branch November 24, 2023 14:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants