Your SlideShare is downloading. ×
0
Provisioning
ProfileslikeaPro
Monday, September 9, 13
JayGraves
CTO
Monday, September 9, 13
LotsofApps
Monday, September 9, 13
ShipIt
Monday, September 9, 13
ProvisioningProfiles
Howdotheywork?
Monday, September 9, 13
ProvisioningProfiles
Whatarethey?
SMIME/PKCS#7
Originallydesignedforemailsigning&encryption.
Monday, September 9, 13
ReadaProvisioningProfile
vim
Monday, September 9, 13
ReadaProvisioningProfile
openssl
openssl smime -in ./your.mobileprovision -inform der -verify
openssl smime -in /path/to/y...
ImportantValues
application-identifier
<key>application-identifier</key>
<string>ABCDEFGHIJK.com.your.bundleid</string>
Mo...
ImportantValues
Entitlements
<key>Entitlements</key>
<dict>
...
<key>com.apple.developer.ubiquity-container-
identifiers</...
ImportantValues
ProvisionedDevices
<key>ProvisionedDevices</key>
<array>
<string>7af8ee3af8e4e13193bd834bab50e1d...</strin...
ImportantValues
UUID
<key>UUID</key>
<string>E0EF8ACE-E83A-475C-9DA7-C67A147659FD</
string>
Monday, September 9, 13
ImportantValues
DeveloperCertificates
<key>DeveloperCertificates</key>
! <array>
! ! <data>
MIIFnDCCBISgAwIBAgIIEIdrqpJlb9...
ImportantValues
DeveloperCertificates
-----BEGIN CERTIFICATE-----
MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYx...
ImportantValues
DeveloperCertificates
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
10:87:6b:aa:92:65:6f:d3
Signature...
InstallaProvisioningProfile
Don’tdoubleclickthem.
Nothumanreadable.
Monday, September 9, 13
InstallaProvisioningProfile
DragthemintotheFinder
~/Library/MobileDevice/Provisioning Profiles
Monday, September 9, 13
InstallaProvisioningProfile
DragthemintotheFinder
Monday, September 9, 13
InstallaProvisioningProfile
DragthemintotheFinder
Muchbetter
Monday, September 9, 13
ToolsforusingProvisioningProfiles
Terminal.app
Monday, September 9, 13
ToolsforusingProvisioningProfiles
Terminal.app-bashalias
alias prov='openssl smime -inform der -verify -in'
Monday, Septem...
ToolsforusingProvisioningProfiles
QuicklookPlugin
http://www.macmation.com/blog/2011/10/quicklook-plugin-for-mobile-provis...
ToolsforusingProvisioningProfiles
AutomatorService
Monday, September 9, 13
ToolsforusingProvisioningProfiles
AutomatorService
http://cl.ly/MTZb
Monday, September 9, 13
ToolsforusingProvisioningProfiles
AutomatorService
Monday, September 9, 13
Xcode
Monday, September 9, 13
Xcode
Howdoesitseeprofiles?
CODE_SIGN_IDENTITY = "iPhone Developer";
PROVISIONING_PROFILE = "";
Monday, September 9, 13
Xcode
Howdoesitseeprofiles?
CODE_SIGN_IDENTITY = "iPhone Developer: Jay Graves (E6L876QFM6)";
PROVISIONING_PROFILE = "0FEB...
Xcode
Builderror
Monday, September 9, 13
Xcode
Updatetheprofile.
Monday, September 9, 13
Xcode
ProjectDiff
Monday, September 9, 13
•Automatic Profiles
•Good if you don’t have multiple projects.
•It can select the wrong profile.
•Rules on automatic selecti...
Monday, September 9, 13
Scenario
1Project 2Builds
Monday, September 9, 13
•Add a Duplicate Target
•Large project file change
•Duplicated all of the Configurations
•A 2nd info.plist has been created....
MultipleBuildScenario
Abettersolution
.xcconfigfile
Monday, September 9, 13
MultipleBuildScenario
Createa.xcconfigfile
Monday, September 9, 13
MultipleBuildScenario
Createa.xcconfigfile
CODE_SIGN_IDENTITY = iPhone Distribution: Double Encore
PROVISIONING_PROFILE = ...
MultipleBuildScenario
Buildwitha.xcconfigfile
xcodebuild -xcconfig second_build.xcconfig
Monday, September 9, 13
Thiscanbebetter!
Automateit
•Every Provisioning Profile contains all the information we need.
•CODE_SIGN_IDENTITY is in the...
Thiscanbebetter!
Thescript
http://bit.ly/xcconfig
#!/usr/bin/env	
  python
from	
  M2Crypto	
  import	
  SMIME,	
  X509,	
 ...
Thiscanbebetter!
Thescript
http://bit.ly/xcconfig
developerCert	
  =	
  X509.load_cert_string(developerPEM)
items	
  =	
  
...
Whathaveweaccomplished?
•Real file based Provisioning Profile selection.
•Zero ambiguity about which profile will be selected...
OK,OK,Enoughwiththe
ProvisioningProfiles
already.
Monday, September 9, 13
Keychain
Access
Monday, September 9, 13
MultipleKeychains
Monday, September 9, 13
SwitchKeychains
security default-keychain -d user -s /FULLPATH/My.keychain
security unlock-keychain -p ******* /FULLPATH/M...
SwitchKeychains
Error: User interaction is not allowed.
unlockkeychain
Monday, September 9, 13
SwitchKeychains
unlockkeychain
Monday, September 9, 13
KeychainError
Code	
  Sign	
  error:	
  Certificate	
  identity	
  'iPhone	
  
Developer:	
  Your	
  Name	
  (NNNNNNNN)'	
...
OTAInstall
Monday, September 9, 13
md5
checksum
Monday, September 9, 13
md5checksum
doesn’twork
Monday, September 9, 13
Installmultipleapps
atthesametime
Monday, September 9, 13
Installmultipleapps
atthesametime
Monday, September 9, 13
Installmultipleapps
atthesametime
Monday, September 9, 13
ThankYou
jay@doubleencore.com
@skabber
Monday, September 9, 13
Upcoming SlideShare
Loading in...5
×

Provisioning profiles like a Pro

3,441

Published on

Learn exactly what Provisioning Profiles are and how to use them better in your day to day workflow.

Published in: Technology, News & Politics
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,441
On Slideshare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
35
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Provisioning profiles like a Pro"

  1. 1. Provisioning ProfileslikeaPro Monday, September 9, 13
  2. 2. JayGraves CTO Monday, September 9, 13
  3. 3. LotsofApps Monday, September 9, 13
  4. 4. ShipIt Monday, September 9, 13
  5. 5. ProvisioningProfiles Howdotheywork? Monday, September 9, 13
  6. 6. ProvisioningProfiles Whatarethey? SMIME/PKCS#7 Originallydesignedforemailsigning&encryption. Monday, September 9, 13
  7. 7. ReadaProvisioningProfile vim Monday, September 9, 13
  8. 8. ReadaProvisioningProfile openssl openssl smime -in ./your.mobileprovision -inform der -verify openssl smime -in /path/to/your.mobileprovision -inform der -verify -noverify https://skabber.snipt.net/provisioning-profile-tips-tricks/ Monday, September 9, 13
  9. 9. ImportantValues application-identifier <key>application-identifier</key> <string>ABCDEFGHIJK.com.your.bundleid</string> Monday, September 9, 13
  10. 10. ImportantValues Entitlements <key>Entitlements</key> <dict> ... <key>com.apple.developer.ubiquity-container- identifiers</key> ... <key>com.apple.developer.ubiquity-kvstore- identifier</key> ... <key>get-task-allow</key> ... </dict> Monday, September 9, 13
  11. 11. ImportantValues ProvisionedDevices <key>ProvisionedDevices</key> <array> <string>7af8ee3af8e4e13193bd834bab50e1d...</string> <string>a9f0d0477a6d3e8dad0ff984f7ba77e...</string> </array> Monday, September 9, 13
  12. 12. ImportantValues UUID <key>UUID</key> <string>E0EF8ACE-E83A-475C-9DA7-C67A147659FD</ string> Monday, September 9, 13
  13. 13. ImportantValues DeveloperCertificates <key>DeveloperCertificates</key> ! <array> ! ! <data> MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYxCzAJ BgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBs ZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBw bGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlv ... Monday, September 9, 13
  14. 14. ImportantValues DeveloperCertificates -----BEGIN CERTIFICATE----- MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYxCzAJ BgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBs ZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBw bGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlv ... -----END CERTIFICATE----- openssl x509 -text -in cert.pem Monday, September 9, 13
  15. 15. ImportantValues DeveloperCertificates Certificate: Data: Version: 3 (0x2) Serial Number: 10:87:6b:aa:92:65:6f:d3 Signature Algorithm: sha1WithRSAEncryption Issuer: C=US, O=Apple Inc., OU=Apple Worldwide Developer Relations, CN=Apple Worldwide Developer Relations Certification Authority Validity Not Before: Nov 3 21:38:10 2012 GMT Not After : Nov 3 21:38:10 2013 GMT Subject: UID=9K9F9LCV74, CN=iPhone Distribution: Massively Overrated, OU=9K9F9LCV74, O=Massively Overrated, C=US Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): 00:c8:57:f9:cf:af:c2:4d:7a:8a:16:62:47:4b:c2: Monday, September 9, 13
  16. 16. InstallaProvisioningProfile Don’tdoubleclickthem. Nothumanreadable. Monday, September 9, 13
  17. 17. InstallaProvisioningProfile DragthemintotheFinder ~/Library/MobileDevice/Provisioning Profiles Monday, September 9, 13
  18. 18. InstallaProvisioningProfile DragthemintotheFinder Monday, September 9, 13
  19. 19. InstallaProvisioningProfile DragthemintotheFinder Muchbetter Monday, September 9, 13
  20. 20. ToolsforusingProvisioningProfiles Terminal.app Monday, September 9, 13
  21. 21. ToolsforusingProvisioningProfiles Terminal.app-bashalias alias prov='openssl smime -inform der -verify -in' Monday, September 9, 13
  22. 22. ToolsforusingProvisioningProfiles QuicklookPlugin http://www.macmation.com/blog/2011/10/quicklook-plugin-for-mobile-provision-files/ Monday, September 9, 13
  23. 23. ToolsforusingProvisioningProfiles AutomatorService Monday, September 9, 13
  24. 24. ToolsforusingProvisioningProfiles AutomatorService http://cl.ly/MTZb Monday, September 9, 13
  25. 25. ToolsforusingProvisioningProfiles AutomatorService Monday, September 9, 13
  26. 26. Xcode Monday, September 9, 13
  27. 27. Xcode Howdoesitseeprofiles? CODE_SIGN_IDENTITY = "iPhone Developer"; PROVISIONING_PROFILE = ""; Monday, September 9, 13
  28. 28. Xcode Howdoesitseeprofiles? CODE_SIGN_IDENTITY = "iPhone Developer: Jay Graves (E6L876QFM6)"; PROVISIONING_PROFILE = "0FEB5831-22D3-4B1D-A973-59ED243E8103"; Monday, September 9, 13
  29. 29. Xcode Builderror Monday, September 9, 13
  30. 30. Xcode Updatetheprofile. Monday, September 9, 13
  31. 31. Xcode ProjectDiff Monday, September 9, 13
  32. 32. •Automatic Profiles •Good if you don’t have multiple projects. •It can select the wrong profile. •Rules on automatic selection are not defined. •Specific Profiles •Much more control over which profile is selected. •Can be a pain to update the project file every time a profile is updated. Whatdoesallthismean? Monday, September 9, 13
  33. 33. Monday, September 9, 13
  34. 34. Scenario 1Project 2Builds Monday, September 9, 13
  35. 35. •Add a Duplicate Target •Large project file change •Duplicated all of the Configurations •A 2nd info.plist has been created. • Add a new Configuration •Still a large project file change •Still duplicated all the build options •Easy to forget new build options MultipleBuildScenario PossibleSolutions Monday, September 9, 13
  36. 36. MultipleBuildScenario Abettersolution .xcconfigfile Monday, September 9, 13
  37. 37. MultipleBuildScenario Createa.xcconfigfile Monday, September 9, 13
  38. 38. MultipleBuildScenario Createa.xcconfigfile CODE_SIGN_IDENTITY = iPhone Distribution: Double Encore PROVISIONING_PROFILE = 1203C18-8F08-45D8-A5AC-76AD9319CDDC Monday, September 9, 13
  39. 39. MultipleBuildScenario Buildwitha.xcconfigfile xcodebuild -xcconfig second_build.xcconfig Monday, September 9, 13
  40. 40. Thiscanbebetter! Automateit •Every Provisioning Profile contains all the information we need. •CODE_SIGN_IDENTITY is in the DeveloperCertificates •PROVISIONING_PROFILE is the UUID Monday, September 9, 13
  41. 41. Thiscanbebetter! Thescript http://bit.ly/xcconfig #!/usr/bin/env  python from  M2Crypto  import  SMIME,  X509,  BIO,  m2 import  plistlib ... plist  =  plistlib.readPlistFromString(blob) developerPEM  =  "-­‐-­‐-­‐-­‐-­‐BEGIN  CERTIFICATE-­‐-­‐-­‐-­‐-­‐n%s-­‐-­‐-­‐-­‐-­‐ END  CERTIFICATE-­‐-­‐-­‐-­‐-­‐"  %  plist["DeveloperCertificates"] [0].asBase64() Monday, September 9, 13
  42. 42. Thiscanbebetter! Thescript http://bit.ly/xcconfig developerCert  =  X509.load_cert_string(developerPEM) items  =   developerCert.get_subject().get_entries_by_nid(X509.X5 09_Name.nid["CN"]) ... open(outXcConfig,  'w').write("CODE_SIGN_IDENTITY  =  %s nPROVISIONING_PROFILE  =  %sn"  %  (codeSignIdentity,   plist["UUID"])) Monday, September 9, 13
  43. 43. Whathaveweaccomplished? •Real file based Provisioning Profile selection. •Zero ambiguity about which profile will be selected. •No mismatched Profiles in Xcode’s Code Signing Identity. •Other than downloading the profile from the iOS Dev Center there is no work for you! Monday, September 9, 13
  44. 44. OK,OK,Enoughwiththe ProvisioningProfiles already. Monday, September 9, 13
  45. 45. Keychain Access Monday, September 9, 13
  46. 46. MultipleKeychains Monday, September 9, 13
  47. 47. SwitchKeychains security default-keychain -d user -s /FULLPATH/My.keychain security unlock-keychain -p ******* /FULLPATH/My.keychain unlockkeychain Monday, September 9, 13
  48. 48. SwitchKeychains Error: User interaction is not allowed. unlockkeychain Monday, September 9, 13
  49. 49. SwitchKeychains unlockkeychain Monday, September 9, 13
  50. 50. KeychainError Code  Sign  error:  Certificate  identity  'iPhone   Developer:  Your  Name  (NNNNNNNN)'  appears  more  than   once  in  the  keychain Monday, September 9, 13
  51. 51. OTAInstall Monday, September 9, 13
  52. 52. md5 checksum Monday, September 9, 13
  53. 53. md5checksum doesn’twork Monday, September 9, 13
  54. 54. Installmultipleapps atthesametime Monday, September 9, 13
  55. 55. Installmultipleapps atthesametime Monday, September 9, 13
  56. 56. Installmultipleapps atthesametime Monday, September 9, 13
  57. 57. ThankYou jay@doubleencore.com @skabber Monday, September 9, 13
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×