Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Explicit provisioning_profile_path not used? #69

Closed
vittoriom opened this issue Aug 27, 2015 · 18 comments
Closed

Explicit provisioning_profile_path not used? #69

vittoriom opened this issue Aug 27, 2015 · 18 comments
Labels

Comments

@vittoriom
Copy link

I'm using gym to build an enterprise version of our app. Just for this task it should use an explicitly provided provisioning profile and code signing identity, that override the ones defined in the project.

I'm building with the --verbose flag since after the first try I saw that it was using the wrong (as defined in the Xcode project) provisioning profile instead, but it looks like the generated build command doesn't include any parameter for passing the specified provisioning profile.

Is there any step I'm missing?

Generated build command:

set -o pipefail && xcodebuild 
-scheme '[REDACTED]' 
-project './[REDACTED].xcodeproj' 
-configuration 'Release' 
-destination 'generic/platform=iOS' 
-xcconfig 'config/Debug.xcconfig' 
-archivePath '/Users/vmonaco/Library/Developer/Xcode/Archives/2015-08-27/[REDACTED] 2015-08-27 12.48.13.xcarchive' 
archive | xcpretty

The command I used is:

gym 
--xcconfig "config/Debug.xcconfig" 
--codesigning_identity "iPhone Distribution: [REDACTED]" 
--provisioning_profile_path: "../CodeSigning/Enterprise.mobileprovision" 
--scheme "[REDACTED]" 
--configuration "Release"
--verbose

After xcodebuild finishes, I got the following command:

/usr/bin/xcrun 
/tmp/PackageApplication4Gym 
-v /Users/vmonaco/Library/Developer/Xcode/Archives/2015-08-27/[REDACTED]\ 2015-08-27\ 12.48.13.xcarchive/Products/Applications/[REDACTED].app 
-o '/Users/vmonaco/Library/Developer/Xcode/Archives/2015-08-27/[REDACTED].ipa' exportFormat ipa --sign 'iPhone Distribution: [REDACTED]'

But nowhere I can see the embedded provisioning being set.

@vittoriom vittoriom changed the title Explicit codesigning_identity and provisioning_profile_path not used? Explicit provisioning_profile_path not used? Aug 27, 2015
@KrauseFx
Copy link
Contributor

It should be used in this command

/usr/bin/xcrun 
/tmp/PackageApplication4Gym 
-v /Users/vmonaco/Library/Developer/Xcode/Archives/2015-08-27/[REDACTED]\ 2015-08-27\ 12.48.13.xcarchive/Products/Applications/[REDACTED].app 
-o '/Users/vmonaco/Library/Developer/Xcode/Archives/2015-08-27/[REDACTED].ipa' exportFormat ipa --sign 'iPhone Distribution: [REDACTED]'

but it looks like only the code signing identity was added.

I'll need to take a closer look on why this isn't set. I assume you're using gym 0.4.5?

@vittoriom
Copy link
Author

Yes, I'm using gym 0.4.5.

Eventually I went with the $(PROFILE_UDID) solution described in the Advanced.md file, but I would like to be able to set the provisioning profile in Xcode and only override it in gym for the special case I need.

Thanks!

@dtrenz
Copy link

dtrenz commented Sep 16, 2015

I'm seeing the same thing. It appears that gym ignores the provisioning_profile_path option when archiving.

@KrauseFx
Copy link
Contributor

It seems like it's working for me. Could you try using the latest version and show the complete output while running gym, including the generated commands?

@KrauseFx KrauseFx reopened this Sep 16, 2015
@dtrenz
Copy link

dtrenz commented Sep 16, 2015

Using gym version 0.5.0.

Fastfile:

gym( provisioning_profile_path: "./path/to/MyApp.mobileprovision" )

Output:

set -o pipefail && xcodebuild -workspace '[Redacted].xcworkspace' -scheme '[Redacted]' -destination 'generic/platform=iOS' -archivePath '[Redacted]' archive | xcpretty

Provisioning profile never makes it into the xcodebuild command for archiving. Same for codesigning_identity.

My current workaround is to just forward the GYM ENV vars for identity or profile through via xcargs:

gym( xcargs: "CODE_SIGN_IDENTITY='#{ENV["GYM_CODE_SIGNING_IDENTITY"]}'" )

@miottid
Copy link

miottid commented Sep 28, 2015

Same here

gym(
      scheme: 'MyScheme',
      configuration: 'MyApp Configuration',
      provisioning_profile_path: './mypath.mobileprovision',
      output_name: 'myApp.ipa')

set -o pipefail && xcodebuild -workspace './MyApp.xcworkspace' -scheme 'MyScheme' -configuration 'MyAppConfiguration' -destination 'generic/platform=iOS' -archivePath '/Users/MyUser/Library/Developer/Xcode/Archives/2015-09-28/./MyApp 2015-09-28 14.51.09.xcarchive' archive | tee '/Users/MyUser/Library/Logs/gym/MyApp.log' | xcpretty

After archiving, I can see that the ipa is not using the mobileprovision provided in the gym command.

Cheers.

@KrauseFx
Copy link
Contributor

@dmiotti If you use Xcode 7 you should get this message:

          Helper.log.info "You're using Xcode 7, the `provisioning_profile_path` value will be ignored".yellow
          Helper.log.info "Please follow the Code Signing Guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md".yellow

as this option was deprecated by the xcodebuild command

@yakimant
Copy link

yakimant commented Nov 5, 2015

Do I understand right, that instead of provisioning_profile_path I should install profile to ~/Library/MobileDevice/Provisioning\ Profiles and select it by PROVISIONING_PROFILE?

I mean:

  1. There is no way to point out to provisioning profile in non-default folder
  2. There is no provisioning_profile option for gym
    Right?

Or:
3) provisioning profile is not needed for archive step and only needed on -exportArchive step?
So I can rely on provisioning_profile_path option and it will use the right one?

Thanks!

@KrauseFx
Copy link
Contributor

KrauseFx commented Nov 8, 2015

@yakimant Have you seen the code signing guide? It should clarify your question.

@yakimant
Copy link

yakimant commented Nov 8, 2015

@KrauseFx, I've read it multiple times, believe me ;)

But there is no information about provisioning_profile_path gym argument there, neither about PROVISIONING_PROFILE xcargs gym parameter.
Don't they both work as it is predicted and I should rely only on solutiions in code signing guide?

Thank you!

@KrauseFx
Copy link
Contributor

KrauseFx commented Nov 8, 2015

The option is not used in the latest version of sigh, please use the recommended method in the code signing guide instead, by passing the UDID of the provisioning profile to the gym action.

@knitterb-razzle
Copy link

This still doesn't make sense to me. The code signing guide referenced here has everything listed as deprecated, the new one says "just create all the certs for each type of build and magic happens" (paraphrasing). Unfortunately, my "Debug" build and "Release" build both use the same distribution certificates. How do I tell gym to use the distribution/appstore certificates for "Release" and the development certificates for "Debug"? Seems like this step is missing.

FWIW, the docs for sigh say this is no longer recommended, but that match should be used, so my Fastfile is fairly simple now:

lane :dev do
    gym(scheme: "MyApp", configuration: "Debug")
end
lane :beta do
    gym(scheme: "MyApp")
    pilot(skip_submission: true)
end

If I do add sigh in there before the gym call I end up with sigh thinking it has to make a new provisioning profile on each run.

(Sorry if my tone is grumpy, I'm frustrated...mostly at myself because I think I'm missing something!)

@mlvea
Copy link

mlvea commented Jan 6, 2016

@KrauseFx what is defaults if I'm not using match. Does gym select provisioning profile based on configuration in xcode? I'm running a issue that fabric complaining device ids missing after submitting a build by gym.

@natanrolnik
Copy link

Interesting - I'm having the same issues that @yakimant and @MadNik . It seems that even if you set:

PROVISIONING_PROFILE = "$(PROFILE_UUID)";

The build itself is fine, in the archive the correct provisioning profile can be found; but the export from archive operation takes the provisioning profile from ~/Library/MobileDevice/Provisioning\ Profiles, that may be outdated...

@KrauseFx
Copy link
Contributor

You should use match which will tell you how to setup your Xcode project: https://github.com/fastlane/match#setup-xcode-project

@knitterb-razzle
Copy link

I switched to using this and it appears to work. (note: added sigh to the dev lane)

lane :dev do
    sigh(development: true)
    gym(scheme: "MyApp", configuration: "Debug")
end
lane :beta do
    gym(scheme: "MyApp")
    pilot(skip_submission: true)
end

Probably the most confusing is that even though I used match to separately set up our certs, I didn't include the suggested Provisioning Profile settings and it still works. Ambiguity like this makes it feel like magic. No clue why it's working, but it is. I wish I knew why.

@KrauseFx
Copy link
Contributor

@knitterb-razzle that's Xcode magic then, it will automatically choose the right profile sometimes., I'd recommend setting it in the project like described in the match README

@fastlane-bot-helper
Copy link

This issue was migrated to fastlane/fastlane#1866. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo 🚀

@fastlane-old fastlane-old locked and limited conversation to collaborators Mar 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants