Class: FastlaneCore::ProvisioningProfile
- Inherits:
-
Object
- Object
- FastlaneCore::ProvisioningProfile
- Defined in:
- lib/fastlane_core/provisioning_profile.rb
Class Method Summary collapse
-
.install(path) ⇒ Object
Installs a provisioning profile for Xcode to use.
-
.parse(path) ⇒ Hash
The hash with the data of the provisioning profile.
- .profiles_path ⇒ Object
-
.uuid(path) ⇒ String
The UUID of the given provisioning profile.
Class Method Details
.install(path) ⇒ Object
Installs a provisioning profile for Xcode to use
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/fastlane_core/provisioning_profile.rb', line 52 def install(path) UI.("Installing provisioning profile...") profile_filename = uuid(path) + ".mobileprovision" destination = File.join(profiles_path, profile_filename) if path != destination # copy to Xcode provisioning profile directory FileUtils.copy(path, destination) unless File.exist?(destination) UI.user_error!("Failed installation of provisioning profile at location: '#{destination}'") end end true end |
.parse(path) ⇒ Hash
Returns The hash with the data of the provisioning profile.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fastlane_core/provisioning_profile.rb', line 24 def parse(path) require 'plist' plist = Plist.parse_xml(`security cms -D -i "#{path}" 2> /dev/null`) # /dev/null: https://github.com/fastlane/fastlane/issues/6387 if (plist || []).count > 5 plist else UI.error("Error parsing provisioning profile at path '#{path}'") nil end end |
.profiles_path ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/fastlane_core/provisioning_profile.rb', line 41 def profiles_path path = File.("~") + "/Library/MobileDevice/Provisioning Profiles/" # If the directory doesn't exist, create it first unless File.directory?(path) FileUtils.mkdir_p(path) end return path end |
.uuid(path) ⇒ String
Returns The UUID of the given provisioning profile.
37 38 39 |
# File 'lib/fastlane_core/provisioning_profile.rb', line 37 def uuid(path) parse(path).fetch("UUID") end |