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

[TestFlight] MAS Build not available for Testing #251

Closed
idoodler opened this issue Nov 4, 2021 · 40 comments
Closed

[TestFlight] MAS Build not available for Testing #251

idoodler opened this issue Nov 4, 2021 · 40 comments

Comments

@idoodler
Copy link

idoodler commented Nov 4, 2021

Apple Released TestFlight for macOS. But somehow our macOS builds are not available for testing in AppStoreConnect.

As stated in the "Meet TestFlight on Mac" WWDC Session Native mac Apps require a provisioning profile to be embedded, but as we don't use automatic code signing by xcode but rather electron-builder we have to supply the provisioning profile our selfs.

I don't quite understand what provisioning profile is required and where to get it?

Does anyone have informations on how to archive this?

I am planing on utilizing fastlane, thus I also created an issue here: fastlane/fastlane#19296

@MarshallOfSound
Copy link
Member

You make provisioning profiles in the Apple Developer Center --> https://developer.apple.com/membercenter

@MarshallOfSound
Copy link
Member

You make provisioning profiles in the Apple Developer Center --> https://developer.apple.com/membercenter

@spChief
Copy link

spChief commented Nov 10, 2021

I create new provision profile yesterday and upload several builds to appstore, all of them has "Not available for testing" status. But I can send it to review and release.
Building pkg with command:
electron-builder --mac=mas -c.mac.provisioningProfile=./embedded.provisionprofile
Uploading with Transporter.
Maybe I need any additional actions for TestFlight availability?
image

@idoodler
Copy link
Author

I do have the same issue as @spChief shows. I can submit the app to the AppStore, but not to TestFlight. There is no further information about the issue in AppStoreConnect. However I am just trying out this. I will keep you updated

@spChief
Copy link

spChief commented Nov 10, 2021

@idoodler Thanks, it's work for me, now I can send builds to TestFlight

@idoodler
Copy link
Author

@spChief Did you recreate your certificate or your profile?

@spChief
Copy link

spChief commented Nov 12, 2021

@idoodler Yes, I recreated cert and profile, but just cause it was expiring. I don't know, does it help or not.

@idoodler
Copy link
Author

@spChief Yesterday I created a new Mac App Distribution certificate and a new Provisioning Profile with the newly created Certificate. Created a new all-certs.p12 imported all certs in my keychain and removed the old.

No change 👎

@spChief
Copy link

spChief commented Nov 12, 2021

@idoodler Mac App Installer cert I was recreated too. What command do you use for building?
Mine looks like this:

CSC_NAME='3rd Party Mac Developer Application:...' electron-builder --mac=mas -c.mac.provisioningProfile=./embedded.provisionprofile

and after that finishes I use some custom sign bash script. I need it for sign some native node modules.

@idoodler
Copy link
Author

I will generate all certificates after my holidays. I also use a bash script that resigns all the native node modules.

My command looks like this:
electron-builder -m -c './build/electron-build-mac-mas.json' && sh ./build/resignAndPackage.sh
the electron-build-mac-mas.json is generated before each build to have a more granular control of the properties. In there is the 'provisioningProfile' property set to the newly generated file.

@spChief
Copy link

spChief commented Nov 12, 2021

@idoodler And you also add these 4 lines to entitlements from Fastlane thread?

@idoodler
Copy link
Author

@spChief Yes, but I didn't recreate the installer cert. I will simply recreate all certificates after my holidays. I will keep you updated

@alariej
Copy link

alariej commented Dec 11, 2021

Same problem here. I've tried the suggestion by @spChief at fastlane/fastlane#19296 (comment) (btw the XXXXXXX in the suggestion is the Development Team ID) but no luck, build is still "not available for testing". I am uploading the app to AppStoreConnect via Transporter and can submit the build for release without problem.

@idoodler
Copy link
Author

@alariej Maybe it depends on the Electron Version? We still use a fairly old one: 9.1.0 (😳 Yes, I know)

@goodhyun
Copy link

I don't know why, but I just deleted hardenedRuntime and gatekeeperAssess options and specifically assigned entitlementsLoginHelper and it worked. 🤪

const osxConfig = {
  category: 'public.app-category.productivity',
  icon: 'app/app.icns',  
  // hardenedRuntime: false,
  // gatekeeperAssess: false,
  entitlements: 'parent.plist',
  entitlementsInherit: 'child.plist',
  entitlementsLoginHelper: 'loginhelper.plist',
  target: {
    target: 'mas',
    // arch: ['x64', 'arm64']
    arch: 'universal'
  },

@Thomas-Vos
Copy link

@idoodler did you figure out how to get TestFlight working?

@idoodler
Copy link
Author

I finally upgraded to Electron v17.1.0, now I get an error regarding a missing Provisioning Profile, i am investigating...

@devinbinnie
Copy link

Has anyone been able to get around this? I read in the docs that it requires Xcode 13: https://help.apple.com/app-store-connect/#/devdc42b26b8. Wasn't sure if that's an issue.

I'm also using electron-builder. I've tried with both the 3rd Party Mac Developer Application and Apple Distribution certs, neither have worked. I seem to be able to submit just fine for a regular App Store build.

@idoodler
Copy link
Author

I created an issue at Apple to finally solve this

@devinbinnie
Copy link

I don't know why, but I just deleted hardenedRuntime and gatekeeperAssess options and specifically assigned entitlementsLoginHelper and it worked. 🤪

const osxConfig = {
  category: 'public.app-category.productivity',
  icon: 'app/app.icns',  
  // hardenedRuntime: false,
  // gatekeeperAssess: false,
  entitlements: 'parent.plist',
  entitlementsInherit: 'child.plist',
  entitlementsLoginHelper: 'loginhelper.plist',
  target: {
    target: 'mas',
    // arch: ['x64', 'arm64']
    arch: 'universal'
  },

This is what finally solved it for me :)

@idoodler
Copy link
Author

So I contacted Apple Support and according to them I need to add the property "application-identifier".

Thats all, no information where or about the value. I contacted them again for some further infos :)

@Deveosys
Copy link

@idoodler Same here, I'm still waiting for them to come back to me.
I have the "application-identifier" key in all my .plist files but no more luck.

<key>com.apple.application-identifier</key>
<string>XXXX.com.company.app</string>

Where XXXX is your TeamID

@idoodler
Copy link
Author

@Deveosys Same here, key and value is set, now the support guy told me the following:

I have checked the new build uploaded and, although it includes a valid identifier, it’s lacking of a provisioning profile. So the solution seems to pass by added the required provisioning profile and submit a new build.

I checked the .app and there is a file called embedded.provisionprofile present. So I sent him a reply.

@Deveosys
Copy link

@idoodler Hey, I got the exact same reply today.
I checked with MD5 the embedded.provisionprofile in .app and the .provisionprofile I created and downloaded from "Certificates, Identifiers & Profiles" web page. It's the same.

@idoodler
Copy link
Author

@devinbinnie Does your entitlement files include the com.apple.application-identifier key? Also does your app include the embedded.provisionprofile?

@devinbinnie
Copy link

devinbinnie commented Mar 30, 2022

@devinbinnie Does your entitlement files include the com.apple.application-identifier key? Also does your app include the embedded.provisionprofile?

Yes to both. I'm doing my build through electron-builder which allows me to specify the provisioning profile, and I've added the application-identifier line that matches the AppID and the OrgID for my organization.

You can have a look at my configuration here if you wish.

@idoodler
Copy link
Author

idoodler commented Apr 1, 2022

So I made it🎉

What did the trick:

  • Adopting the entitlements file
    • entitlements.mas.plist
      • Must include com.apple.application-identifier an com.apple.developer.team-identifier
    • entitlements.mas.inherit.plist and entitlements.mas.loginhelper.plist
      • Must not contain com.apple.application-identifier or com.apple.developer.team-identifier
  • Setting the hardenedRuntime and gatekeeperAssess (properties will be inherited if not present here)
    • mac
      • hardenedRuntime: true
      • gatekeeperAssess: true
    • mas
      • hardenedRuntime: false

My next task is how to detect if the app is installed via TestFlight...

@idoodler
Copy link
Author

idoodler commented Apr 5, 2022

@devinbinnie Have you been able to submit the app to an external TestFlight group? Mine gets rejected due to the following error. Internal groups or MacAppStore submissions are fine tho.

This build is using a beta version of Xcode and can't be submitted. Make sure you're using the
latest version of Xcode or the latest seed release found on the releases tab in a
href="https://developer.apple.com/news/releases/" target=" blank">News and Updates

Same issue as this: electron-userland/electron-builder#6665

@Deveosys
Copy link

Deveosys commented Apr 6, 2022

@idoodler Hey,
I got the same scenario, you have to wait and TestFlight will detect your build as valid.

@idoodler
Copy link
Author

idoodler commented Apr 6, 2022

@idoodler Hey, I got the same scenario, you have to wait and TestFlight will detect your build as valid.

What do you mean. The app has been uploaded yesterday evening, Internal Testing works fine, but when I want to add the External group I get the error. The status of the build is Ready to Submit. How long do you usually need to wait until the app is available for external testing?

@devinbinnie
Copy link

devinbinnie commented Apr 6, 2022

@idoodler I've run into the same issue, it's being tracked by Electron here: electron/electron#33054

Unfortunately waiting won't help, there seems to be an issue with the version of Xcode if I'm understanding correctly. Something will likely need to be fixed on the Electron side/a workaround will need to be found.

@Deveosys
Copy link

Deveosys commented Apr 8, 2022

@idoodler I didn't understood the problem was with external testers ! Didn't try externals tests so far...

@arslankaleem7229
Copy link

did you got any solution for this ???

@idoodler
Copy link
Author

did you got any solution for this ???

The issue is, that Electron binaries are created with an older version of Xcode, thus we have to wait for them to utilize a newer version.

There appears to be a workaround which I have not tested yet: electron/electron#33054 (comment)

@arslankaleem7229
Copy link

I don't know why, but I just deleted hardenedRuntime and gatekeeperAssess options and specifically assigned entitlementsLoginHelper and it worked. 🤪

const osxConfig = {
  category: 'public.app-category.productivity',
  icon: 'app/app.icns',  
  // hardenedRuntime: false,
  // gatekeeperAssess: false,
  entitlements: 'parent.plist',
  entitlementsInherit: 'child.plist',
  entitlementsLoginHelper: 'loginhelper.plist',
  target: {
    target: 'mas',
    // arch: ['x64', 'arm64']
    arch: 'universal'
  },

can you please send the file loginhelper.plist here???

@idoodler
Copy link
Author

I don't know why, but I just deleted hardenedRuntime and gatekeeperAssess options and specifically assigned entitlementsLoginHelper and it worked. 🤪

const osxConfig = {

category: 'public.app-category.productivity',

icon: 'app/app.icns',

// hardenedRuntime: false,

// gatekeeperAssess: false,

entitlements: 'parent.plist',

entitlementsInherit: 'child.plist',

entitlementsLoginHelper: 'loginhelper.plist',

target: {

target: 'mas',
// arch: ['x64', 'arm64']
arch: 'universal'

},

can you please send the file loginhelper.plist here???

This only allows Internal TestFlight testing.

@arslankaleem7229
Copy link

Thanks @idoodler

@Ali-Albaker
Copy link

So I made it🎉

What did the trick:

  • Adopting the entitlements file

    • entitlements.mas.plist

      • Must include com.apple.application-identifier an com.apple.developer.team-identifier
    • entitlements.mas.inherit.plist and entitlements.mas.loginhelper.plist

      • Must not contain com.apple.application-identifier or com.apple.developer.team-identifier
  • Setting the hardenedRuntime and gatekeeperAssess (properties will be inherited if not present here)

    • mac

      • hardenedRuntime: true
      • gatekeeperAssess: true
    • mas

      • hardenedRuntime: false

My next task is how to detect if the app is installed via TestFlight...

That does not work for me. Here's what I have.

  mac: {
    hardenedRuntime: true,
    gatekeeperAssess: true,
    category: 'public.app-category.utilities',
    entitlements: 'electron-build/entitlements.mac.plist',
    entitlementsInherit: 'electron-build/entitlements.mac.plist',
    target: {
      target: 'mas',
      arch: 'universal'
    },
  },
  mas: {
    hardenedRuntime: false,
    entitlements: "electron-build/entitlements.mas.plist",
    entitlementsInherit: "electron-build/entitlements.mas.inherit.plist",
    entitlementsLoginHelper: "electron-build/entitlements.mas.loginhelper.plist",
    provisioningProfile: './embedded.provisionprofile',
    asarUnpack: [],
    // type: "distribution",
    icon: 'electron-build/icon.icns',
    electronLanguages: ['en'],
    extendInfo: {
      ITSAppUsesNonExemptEncryption: false
    },
    singleArchFiles: "*",
    // strictVerify: false,
  },

@idoodler
Copy link
Author

@Ali-Baker What are you trying to archive? As I mentioned the fix only enables internal TestFlight releases.

@Ali-Albaker
Copy link

Ali-Albaker commented Sep 20, 2022

I am trying to submit to App Store Connect for TestFlight but getting Not Available for Testing with the above config using electron-builder to build and Transporter App to upload the .pkg file.

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

10 participants