Here’s my list of new things that I would like to see at WWDC 2016:

Software

  • Siri 3rd party integration
  • Remote view controllers
  • Split view with multiple views of the same app (e.g. 2 Safari instances) in iOS

Hardware

  • Separate Apple 4K/5K Display
  • Re-assign what the buttons on the Apple Watch do
  • HomeKit device similar to Amazon Echo / Google Home

Services

  • Street view for Maps
  • A way to download or at least queue apps for download from the web. If someone runs across a news article for an app, s/he can click on a link to download the app to their device. Google’s Play Store has had this feature for years. For Apple TV in particular.
  • Upgrade pricing for major product updates for apps

If you have a continuous integration server, you might want to build your app with unique version numbers tied to the build.

The agvtool (Apple-generic versioning tool for Xcode projects) is an easy way to update the marketing and build version number within your app.

In your CI system, you can run something like the following to add a build version number where the major version is the same but the .jenkins.$BUILD_NUMBER is appended. $BUILD_NUMBER is provided by Jenkins.

MARKETING_VERSION=$(agvtool what-marketing-version -terse1); agvtool new-version -all $MARKETING_VERSION.jenkins.$BUILD_NUMBER

If you have an enterprise iOS account, you can distribute apps internally using an enterprise distribution certificate. Here are some instructions on how to get an installable IPA via shell commands which you can automate as part of a build process.

You need to have your code signing production certificate downloaded and installed into your Keychain on your build machine. Xcode can do this, or you can download the certificate from the Apple Developer site.

Also, you need to have a mobile provisioning profile installed. The mobile provisioning’s “App ID” should be a prefix (say com.example.*) of your app’s bundle ID (such as com.example.LoremIpsum). Again, you can download via Xcode or via the developer site.

Gather (Optional) Information

While the code signing and provisioning information can be set in the Xcode project’s build configuration, you may want to override the information in your build.

Code Sign Identity

If you need to specify your code signing identity during the build, find your certificate in the Keychain and get the Common Name of the certificate.

The production certificate’s Common Name will be the CODE_SIGN_IDENTITY value.

Mobile Provisioning Profile

If you downloaded the mobile provisioning file, you can open the provisioning profile and find the UUID value in the plist.

If you have downloaded the profile in Xcode, you can go back to Xocde and open the Accounts panel in the Xcode Preferences, look at your logged in Apple ID and View Details, and then find your Provisioning Profile. Right click on the name of the Provisioning Profile and click Show in Finder. You will see a file selected in ~/Library/MobileDevice/Provisioning Profiles. The filename is usually named <UUID>.mobileprovision, or you can verify by opening up the file and find the UUID value.

The UUID will be the PROVISIONING_PROFILE value.

Build an xcarchive

Assuming that LoremIpsum is your Xcode project, you can run the following in your shell:

export BUILD_DIR=$(pwd)/build

mkdir -p $BUILD_DIR

xcrun xcodebuild -project LoremIpsum.xcodeproj -scheme LoremIpsum clean

xcrun xcodebuild CODE_SIGN_IDENTITY="$CODE_SIGN_IDENTITY" PROVISIONING_PROFILE="$PROVISIONING_PROFILE" -project LoremIpsum.xcodeproj -scheme LoremIpsum archive -archivePath LorenIpsum.xcarchive

You now have an Xcode archive which is similar to what is submitted to the App Store.

Export your app from xcarchive

The export archive option in xcodebuild allows a few options which will be saved in a plist file. The $TEAM_ID is the prefix in the App IDs in the Apple Developer portal. It can also be found in the mobile provisioning profile file as TeamIdentifier.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>method</key>
        <string>enterprise</string>
        <key>embedOnDemandResourcesAssetPacksInBundle</key>
        <true/>
        <key>compileBitcode</key>
        <true/>
        <key>teamID</key>
        <string>$TEAM_ID</string>
</dict>
</plist>

The above options compile the Bitcode enabled app and add all of the resources into the app (instead of having on-demand resources).

Then just run:

xcrun xcodebuild -exportArchive -archivePath LorenIpsum.xcarchive -exportPath $BUILD_DIR/ipa -exportOptionsPlist $PATH_TO_PLIST_FILE

You should finally have your app’s IPA in the $BUILD_DIR/ipa directory which you can install by dragging and dropping the IPA to iTunes and then syncing your device with iTunes.