MobileNativeFoundation / rules_xcodeproj

Bazel rules for generating Xcode projects.
MIT License
505 stars 77 forks source link

Feature Request: Develop with personal team #2953

Closed lfxu closed 3 months ago

lfxu commented 4 months ago

Question as title. I imagine it is not possible to generate a project with personal team already selected. I wonder if there is a way to generate a xcode project, then manually select Personal Team. I've tried various combinations of settings but couldn't get it work:

Is there actually a way to achieve this? I'm very surprised this is not even discussed or asked at all.

brentleyjones commented 4 months ago

If you use xcode_provisioning_profile and set managed_by_xcode = True, you shouldn't need to manually select Automatically manage signing, as that is what that attribute does.

What do you mean by Personal team for Development team? I don't see that option.

lfxu commented 4 months ago

From https://developer.apple.com/support/compare-memberships/

If you’re signing in to Xcode with an Apple ID that’s not affiliated with the Apple Developer Program, you'll be able to perform on-device testing for personal use (Xcode refers to this as a Personal Team). However, there are some limitations ...

I guess you won't see it if an account have Apple Developer Program. Of course, in a work environment you will have a certificate to start with, but for personal use it's kind of a high bar at project setup stage.

brentleyjones commented 4 months ago

Can you send me a project that is setup to use a personal team? I can look at it and see if there is anything we can do on the rules_xcodeproj side.

lfxu commented 4 months ago

personal-team-test.zip

Thanks. Here is an empty project created using Xcode with personal team.

brentleyjones commented 4 months ago

So it looks like it just has your specific Team ID set. So you can use team_id on xcode_provisioning_profile to support this use case.

lfxu commented 4 months ago

I've tried that.

  1. It does show a team id once you select the personal team in Xcode. However, setting it in bazel and generate project, you will only see "No account for team " in Xcode.
  2. The personal team is a temporary thing that last only a few days, and is overall quite different from a normal team. For instance, it is impossible to generate a mobileprovision file with a personal team. "local_provisioning_file_finder" will always fail.
brentleyjones commented 4 months ago

I recall when I had a personal account it worked just fine. I believe the team id was stable the whole time as well. It seems that Xcode translates the team id to a display of "Personal team", just like it does to my normal account name.

And yes, there is no provisioning profile to start, but once you open Xcode it will create the Xcode managed profile with a 7 day expiration date (see the Update Signing logs that it produces). Once Xcode creates that file, then local_provisioning_file is able to find it.

brentleyjones commented 3 months ago

Going to close for now, because I believe this is WAI. If you have a specific repro that you want us to look at, comment here and I'll re-open.