Provisioning profiles like a Pro
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Provisioning profiles like a Pro

  • 2,834 views
Uploaded on

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

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

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,834
On Slideshare
1,301
From Embeds
1,533
Number of Embeds
8

Actions

Shares
Downloads
33
Comments
0
Likes
2

Embeds 1,533

http://harrisonjackson.us 1,212
http://www.doubleencore.com 292
http://cloud.feedly.com 20
http://news.google.com 4
http://newsblur.com 2
http://www.newsblur.com 1
http://webcache.googleusercontent.com 1
http://feedreader.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Provisioning ProfileslikeaPro Monday, September 9, 13
  • 2. JayGraves CTO Monday, September 9, 13
  • 3. LotsofApps Monday, September 9, 13
  • 4. ShipIt Monday, September 9, 13
  • 5. ProvisioningProfiles Howdotheywork? Monday, September 9, 13
  • 6. ProvisioningProfiles Whatarethey? SMIME/PKCS#7 Originallydesignedforemailsigning&encryption. Monday, September 9, 13
  • 7. ReadaProvisioningProfile vim Monday, September 9, 13
  • 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. ImportantValues application-identifier <key>application-identifier</key> <string>ABCDEFGHIJK.com.your.bundleid</string> Monday, September 9, 13
  • 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. ImportantValues ProvisionedDevices <key>ProvisionedDevices</key> <array> <string>7af8ee3af8e4e13193bd834bab50e1d...</string> <string>a9f0d0477a6d3e8dad0ff984f7ba77e...</string> </array> Monday, September 9, 13
  • 12. ImportantValues UUID <key>UUID</key> <string>E0EF8ACE-E83A-475C-9DA7-C67A147659FD</ string> Monday, September 9, 13
  • 13. ImportantValues DeveloperCertificates <key>DeveloperCertificates</key> ! <array> ! ! <data> MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYxCzAJ BgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBs ZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBw bGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlv ... Monday, September 9, 13
  • 14. ImportantValues DeveloperCertificates -----BEGIN CERTIFICATE----- MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYxCzAJ BgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBs ZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBw bGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlv ... -----END CERTIFICATE----- openssl x509 -text -in cert.pem Monday, September 9, 13
  • 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. InstallaProvisioningProfile Don’tdoubleclickthem. Nothumanreadable. Monday, September 9, 13
  • 17. InstallaProvisioningProfile DragthemintotheFinder ~/Library/MobileDevice/Provisioning Profiles Monday, September 9, 13
  • 18. InstallaProvisioningProfile DragthemintotheFinder Monday, September 9, 13
  • 19. InstallaProvisioningProfile DragthemintotheFinder Muchbetter Monday, September 9, 13
  • 20. ToolsforusingProvisioningProfiles Terminal.app Monday, September 9, 13
  • 21. ToolsforusingProvisioningProfiles Terminal.app-bashalias alias prov='openssl smime -inform der -verify -in' Monday, September 9, 13
  • 22. ToolsforusingProvisioningProfiles QuicklookPlugin http://www.macmation.com/blog/2011/10/quicklook-plugin-for-mobile-provision-files/ Monday, September 9, 13
  • 23. ToolsforusingProvisioningProfiles AutomatorService Monday, September 9, 13
  • 24. ToolsforusingProvisioningProfiles AutomatorService http://cl.ly/MTZb Monday, September 9, 13
  • 25. ToolsforusingProvisioningProfiles AutomatorService Monday, September 9, 13
  • 26. Xcode Monday, September 9, 13
  • 27. Xcode Howdoesitseeprofiles? CODE_SIGN_IDENTITY = "iPhone Developer"; PROVISIONING_PROFILE = ""; Monday, September 9, 13
  • 28. Xcode Howdoesitseeprofiles? CODE_SIGN_IDENTITY = "iPhone Developer: Jay Graves (E6L876QFM6)"; PROVISIONING_PROFILE = "0FEB5831-22D3-4B1D-A973-59ED243E8103"; Monday, September 9, 13
  • 29. Xcode Builderror Monday, September 9, 13
  • 30. Xcode Updatetheprofile. Monday, September 9, 13
  • 31. Xcode ProjectDiff Monday, September 9, 13
  • 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. Monday, September 9, 13
  • 34. Scenario 1Project 2Builds Monday, September 9, 13
  • 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. MultipleBuildScenario Abettersolution .xcconfigfile Monday, September 9, 13
  • 37. MultipleBuildScenario Createa.xcconfigfile Monday, September 9, 13
  • 38. MultipleBuildScenario Createa.xcconfigfile CODE_SIGN_IDENTITY = iPhone Distribution: Double Encore PROVISIONING_PROFILE = 1203C18-8F08-45D8-A5AC-76AD9319CDDC Monday, September 9, 13
  • 39. MultipleBuildScenario Buildwitha.xcconfigfile xcodebuild -xcconfig second_build.xcconfig Monday, September 9, 13
  • 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. 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. 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. 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. OK,OK,Enoughwiththe ProvisioningProfiles already. Monday, September 9, 13
  • 45. Keychain Access Monday, September 9, 13
  • 46. MultipleKeychains Monday, September 9, 13
  • 47. SwitchKeychains security default-keychain -d user -s /FULLPATH/My.keychain security unlock-keychain -p ******* /FULLPATH/My.keychain unlockkeychain Monday, September 9, 13
  • 48. SwitchKeychains Error: User interaction is not allowed. unlockkeychain Monday, September 9, 13
  • 49. SwitchKeychains unlockkeychain Monday, September 9, 13
  • 50. KeychainError Code  Sign  error:  Certificate  identity  'iPhone   Developer:  Your  Name  (NNNNNNNN)'  appears  more  than   once  in  the  keychain Monday, September 9, 13
  • 51. OTAInstall Monday, September 9, 13
  • 52. md5 checksum Monday, September 9, 13
  • 53. md5checksum doesn’twork Monday, September 9, 13
  • 54. Installmultipleapps atthesametime Monday, September 9, 13
  • 55. Installmultipleapps atthesametime Monday, September 9, 13
  • 56. Installmultipleapps atthesametime Monday, September 9, 13
  • 57. ThankYou jay@doubleencore.com @skabber Monday, September 9, 13