advanced app building - tips, tricks & lessons learned
DESCRIPTION
360iDevMinTRANSCRIPT
Advanced App Building
Tips, Tricks & Lessons Learned
Wednesday, February 6, 13
Jay GravesCTO
Wednesday, February 6, 13
Lots of Apps
Wednesday, February 6, 13
Ship It
Wednesday, February 6, 13
Ship It
Wednesday, February 6, 13
Provisioning Profiles
Wednesday, February 6, 13
Provisioning ProfilesHow do they work?
Wednesday, February 6, 13
Provisioning ProfilesWhat are they?
SMIME / PKCS#7
Originally designed for email signing & encryption.
Wednesday, February 6, 13
Read a Provisioning Profilevim
Wednesday, February 6, 13
Read a Provisioning Profileopenssl
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/
Wednesday, February 6, 13
Important Valuesapplication-identifier
<key>application-identifier</key>
<string>ABCDEFGHIJK.com.your.bundleid</string>
Wednesday, February 6, 13
Important ValuesEntitlements<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>
Wednesday, February 6, 13
Important ValuesProvisionedDevices
<key>ProvisionedDevices</key><array><string>7af8ee3af8e4e13193bd834bab50e1d...</string> <string>a9f0d0477a6d3e8dad0ff984f7ba77e...</string> </array>
Wednesday, February 6, 13
Important ValuesUUID
<key>UUID</key>
<string>E0EF8ACE-E83A-475C-9DA7-C67A147659FD</string>
Wednesday, February 6, 13
Important ValuesDeveloperCertificates
<key>DeveloperCertificates</key>! <array>! ! <data>MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlv...
Wednesday, February 6, 13
Important ValuesDeveloperCertificates
-----BEGIN CERTIFICATE-----MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlv...-----END CERTIFICATE-----
Wednesday, February 6, 13
Important ValuesDeveloperCertificates
-----BEGIN CERTIFICATE-----MIIFnDCCBISgAwIBAgIIEIdrqpJlb9MwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlv...-----END CERTIFICATE-----
openssl x509 -text -in cert.pem
Wednesday, February 6, 13
Important ValuesDeveloperCertificates
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:
Wednesday, February 6, 13
Install a Provisioning Profile
Wednesday, February 6, 13
Install a Provisioning ProfileDon’t double click them.
Not human readable.
Wednesday, February 6, 13
Install a Provisioning ProfileDrag them into the Finder
~/Library/MobileDevice/Provisioning Profiles
Wednesday, February 6, 13
Install a Provisioning ProfileDrag them into the Finder
Wednesday, February 6, 13
Install a Provisioning ProfileDrag them into the Finder
Much betterWednesday, February 6, 13
Tools for using Provisioning ProfilesTerminal.app
Wednesday, February 6, 13
Tools for using Provisioning ProfilesTerminal.app - bash alias
alias prov='openssl smime -inform der -verify -in'
Wednesday, February 6, 13
Tools for using Provisioning ProfilesQuicklook Plugin
http://www.macmation.com/blog/2011/10/quicklook-plugin-for-mobile-provision-files/
Wednesday, February 6, 13
Tools for using Provisioning ProfilesAutomator Service
Wednesday, February 6, 13
Tools for using Provisioning ProfilesAutomator Service
http://cl.ly/MTZb
Wednesday, February 6, 13
Tools for using Provisioning ProfilesAutomator Service
Wednesday, February 6, 13
Xcode
Wednesday, February 6, 13
XcodeHow does it see profiles?
Wednesday, February 6, 13
XcodeHow does it see profiles?
CODE_SIGN_IDENTITY = "iPhone Developer";
Wednesday, February 6, 13
XcodeHow does it see profiles?
CODE_SIGN_IDENTITY = "iPhone Developer";PROVISIONING_PROFILE = "";
Wednesday, February 6, 13
XcodeHow does it see profiles?
Wednesday, February 6, 13
XcodeHow does it see profiles?
CODE_SIGN_IDENTITY = "iPhone Developer: Jay Graves (E6L876QFM6)";
Wednesday, February 6, 13
XcodeHow does it see profiles?
CODE_SIGN_IDENTITY = "iPhone Developer: Jay Graves (E6L876QFM6)";
PROVISIONING_PROFILE = "0FEB5831-22D3-4B1D-A973-59ED243E8103";
Wednesday, February 6, 13
XcodeBuild error
Wednesday, February 6, 13
XcodeBuild error
Wednesday, February 6, 13
XcodeUpdate the profile.
Wednesday, February 6, 13
XcodeUpdate the profile.
Wednesday, February 6, 13
XcodeProject Diff
Wednesday, February 6, 13
What does all this mean?
Wednesday, February 6, 13
•Automatic Profiles•Good if you don’t have multiple projects.•It can select the wrong profile.•Rules on automatic selection are not defined.
What does all this mean?
Wednesday, February 6, 13
•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.
What does all this mean?
Wednesday, February 6, 13
Wednesday, February 6, 13
Wednesday, February 6, 13
Scenario
Wednesday, February 6, 13
Scenario1 Project 2 Builds
Wednesday, February 6, 13
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•Add a Duplicate Target
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•Add a Duplicate Target•Large project file change
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•Add a Duplicate Target•Large project file change•Duplicated all of the Configurations
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•Add a Duplicate Target•Large project file change•Duplicated all of the Configurations•A 2nd info.plist has been created.
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•Add a Duplicate Target•Large project file change•Duplicated all of the Configurations•A 2nd info.plist has been created.
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•Add a Duplicate Target•Large project file change•Duplicated all of the Configurations•A 2nd info.plist has been created.
• Add a new Configuration
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•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
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•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
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
•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
Multiple Build ScenarioPossible Solutions
Wednesday, February 6, 13
Multiple Build ScenarioA better solution
Wednesday, February 6, 13
Multiple Build ScenarioA better solution
.xcconfig file
Wednesday, February 6, 13
Multiple Build ScenarioCreate a .xcconfig file
Wednesday, February 6, 13
Multiple Build ScenarioCreate a .xcconfig file
CODE_SIGN_IDENTITY = iPhone Distribution: Double Encore
PROVISIONING_PROFILE = 1203C18-8F08-45D8-A5AC-76AD9319CDDC
Wednesday, February 6, 13
Multiple Build ScenarioBuild with a .xcconfig file
xcodebuild -xcconfig second_build.xcconfig
Wednesday, February 6, 13
Surprise?
Wednesday, February 6, 13
Surprise?
Wednesday, February 6, 13
Surprise?
Wednesday, February 6, 13
Surprise?
Wednesday, February 6, 13
Surprise?
Wednesday, February 6, 13
OK, OK, Enough with the Provisioning Profiles
already.
Wednesday, February 6, 13
Keychain Access
Wednesday, February 6, 13
Multiple Keychains
Wednesday, February 6, 13
Switch Keychains
security default-keychain -d user -s /FULLPATH/My.keychain
security unlock-keychain -p ******* /FULLPATH/My.keychain
unlock keychain
Wednesday, February 6, 13
Switch Keychains
Error: User interaction is not allowed.
unlock keychain
Wednesday, February 6, 13
Switch Keychainsunlock keychain
Wednesday, February 6, 13
Wednesday, February 6, 13
OTA Install
Wednesday, February 6, 13
md5checksum
Wednesday, February 6, 13
md5 checksumdoesn’t work
Wednesday, February 6, 13
md5 checksumdoesn’t work
Wednesday, February 6, 13
Install multiple appsat the same time
Wednesday, February 6, 13
Install multiple appsat the same time
Wednesday, February 6, 13
Install multiple appsat the same time
Wednesday, February 6, 13
Thank [email protected]@skabber
Wednesday, February 6, 13