distributing native mobile apps

24
DISTRIBUTING NATIVE MOBILE APPS http://www.flickr.com/photos/ourcage/8343799386/

Upload: sullivan-bayly

Post on 30-Mar-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DISTRIBUTING NATIVE MOBILE APPS

DISTRIBUTING NATIVE MOBILE APPShttp://www.flickr.com/photos/ourcage/8343799386/

Page 2: DISTRIBUTING NATIVE MOBILE APPS

Main downside of native: installation

• Mobile web apps are trivial to distribute– Open browser, go to URL, bookmark to home

• Native mobile apps are a pain to distribute– You need a license to create and distribute– You need to deploy to app store– You need to wait for approval– Users need to find, choose, approve, install app

Page 3: DISTRIBUTING NATIVE MOBILE APPS

An overview of distribution

• The goals of this lecture are to…– Summarize the main challenges of distribution– Reveal important differences between distribution

of Android and iOS apps– Give some guidance about how to distribute

• But the lecture is a "snapshot in time"– Distribution processes can and do change– Expect that you will have to adjust with the times

Page 4: DISTRIBUTING NATIVE MOBILE APPS

iOS Development Restrictions

• Every app developer must be identifiable– Individual developers are identifiable by the credit

card number that they use– Companies are identifiable by DUNS number

(registered with the US Federal Government)• Every app’s developer must be identifiable– Through public-key certificates

• Every app must be approved before app store– Reviewed for appropriateness in the app store

Page 5: DISTRIBUTING NATIVE MOBILE APPS

Putting apps on your own iPhone

Apple Developer Registration (free)

iOS Developer Registration ($99)

Device registration (identifies iPhone)

iOS Distribution Certificate

(identifies you)

App ID registration (identifies apps)

Provisioning profile (links all three)

Apple WWDR (identifies Apple)

(free to download)

Used to install apps on device

Page 6: DISTRIBUTING NATIVE MOBILE APPS

Basic steps for getting registered

1. Go to developer.apple.com > Member Center and register as an Apple Developer (free) so you can log in

2. Once logged into the Member Center, sign up as an iOS Developer (not free)– Pay your $99 by credit card– Wait 24-48 hours (yes, really)

Page 7: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

3. Create iOS Distribution Certificate

• The Distribution Certificate is Apple’s permission for you to install apps on devices

• Needed for installation onto your own device (aka ad hoc distribution) or via the app store

• Last time I checked, these steps are documented at developer.apple.com/ios/manage/distribution/

Page 8: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

3. Create iOS Distribution Certificate

3.1 On Mac, use Spotlight to open Keychain 3.2 In Keychain, set preferences OSCP=Off, CRL=Off3.3 In Keychain, use Certificate Assistant to request a

Certificate (2048 bits, RSA), save to hard drive; this is called a Certificate Request

3.4 Go to the Member Center > iOS Provisioning Portal3.5 Select Certificates section, Distribution tab, upload

the Certificate Request. Wait 10 minutes.3.6 Approved certificate should appear on

Development tab.

Page 9: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

3. Register a device

• You have to register every device that you want to install onto via ad hoc distribution (i.e., by sending the binary via email, iTunes, and USB)

3.1 Go to the Devices section of the Member Center3.2 Create a new Device entry, with a memorable name and

the UUID• You can find the device’s UUID in iTunes– Hook it up– Go to iTunes– Click on the Serial number so that it mysteriously

changes into the UUID (seriously)

Page 10: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

4. Register an app id

• App ids identify the developer of apps.• App id = Team ID (you) + bundle id (group of apps)

4.1 Go to the App IDs part of the Member Center and create a new App ID

4.2 Important: your Bundle ID (second half of the App ID) should have the form XXXXX.YYYYY.*

example: com.titaniumbits.* This will let you create many apps, each of whose

names will start with “XXXXX.YYYYY.”

Page 11: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

5. Create a provisioning profile

• Provisioning profile links you (i.e., your Certificate) with a device (or the app store) and with a group of apps (bundle).

5.1 In the Provisioning section of the Member Center, create a new Provisioning Profile

5.2 For development on your own device, use the Development Tab.

5.3 For app store distribution, use the Distribution tab.

Page 12: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

6. Install on your machine

6.1 Download certificates: your own, and the WWDR (basically a key identifying Apple)

6.2 Download provisioning profile6.3 In Finder, double-click the WWDR Certificate to

import it into keychain. Now your Mac trusts Apple. Then double-click your own Certificate to import.

6.4 In Titanium Studio (or xCode), create a new project with an appid of the form XXXXX.YYYYY.ZZZZZZZZ

6.5 Run the app on “iOS Device”. When prompted, provide the provisioning profile you downloaded

Page 13: DISTRIBUTING NATIVE MOBILE APPS

Distributing to App Store

1., 2. Register – you already did this3. Generate another Distribution Certificate – this

one, for the app store4. Create an appid – you already did this5. Create another Provisioning Profile – this one,

for app store (using new Distribution Certificate)

6. Install the Provisioning Profile in Titanium Studio (or xCode)

Page 14: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

7. Set up app on iTunes Connect

7.1 Go to Member Center, to iOS Provisioning Portal, then the iTunes Connect portalThe first time you do this, you’ll be prompted to

accept the iTunes Connect terms of service

7.2 Go to Manage Apps and create an app entry7.3 View details (near bottom of screen) and

confirm it is ready for upload

Page 15: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

8. Build and upload to app store

8.1 Build for distribution8.2 Xcode Organizer opens. Go to the Archives8.3 Select app and click validate against your app entry in

the iTunes Connect site - If it says no suitable app record found, then you

might not have a matching app name, id, version8.4 If the validator complains, fix the problems - Probably have to create some additional icons (see

next slide)8.5 Click submit button to commit to app store

Page 16: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

8.4 Fixing those icons

• If you are using Titanium Studio, then it probably will mess up your icons.– Go to your project in Finder– Go into the Resources/iphone subdirectory– Double-click your appicon.png to open in Preview– Use Tools > size to resize to 114 x 114– Use File > export to save a copy as [email protected]– Use Tools > size to resize to 72x72– Use File > export to save a copy as appicon-72.png– Exit Preview

Page 17: DISTRIBUTING NATIVE MOBILE APPS

(Continuation of previous slide)

8.4 Fixing those icons

– Go back to Titanium Studio– Copy the build/iphone/Info.plist file to the same directory as your

tiapp.xml file– Open the Info.plist file for editing in Dashcode– Add appicon-72.png to the list of icons

<array> <string>appicon-72.png</string> <string>appicon.png</string> <string>[email protected]</string>

</array>

– You may need additional icons as more kinds of devices are invented (i.e., retina and beyond)

– Rebuild and revalidate

Page 18: DISTRIBUTING NATIVE MOBILE APPS

Summary: Submitting to app store

App functions on your own device

Create new iOS Distribution Certificate Provisioning profile

for distribution

Fixed icons Build for deployment (-> archive)

Create iTunes Connect

registration

Validated archive

Submitted archive

App entry on iTunes Connect

Page 19: DISTRIBUTING NATIVE MOBILE APPS

Android Development Restrictions

• Every app developer must be identifiable– Developer accounts are identifiable by the credit

card number that they use• Every app’s developer must be identifiable– Through public-key certificates– But your signature isn’t actually registered with

Google, so it doesn’t do much• Every app must meet basic marketing rules– No actual checks on the code that you write

Page 20: DISTRIBUTING NATIVE MOBILE APPS

Putting apps on your Android device

Google account (free)

Android Publisher Registration ($25) Upload your app

Sign your app

Upload some images

Generate your own key

Approve for distribution

Page 21: DISTRIBUTING NATIVE MOBILE APPS

Basic steps for getting registered

1. Get a Google account (e.g., sign up for gmail)2. Sign in to http://market.android.com/publish– Pay your $25 by credit card– Wait 15 minutes

Page 22: DISTRIBUTING NATIVE MOBILE APPS

3. Create a signature

• Signature doesn’t actually seem to be checked at any step of the process

3.1 Go to command line, cd to private directory3.2 Run this command (all one line):keytool -genkey -v -keystore my-release-

key.keystore -alias mykey -keyalg RSA -keysize 2048 -validity 10000

3.3 Answer the questions about your name, etc.

Page 23: DISTRIBUTING NATIVE MOBILE APPS

4. Build and upload to Market

4.1 In Titanium Studio, build for deployment. Select your key file; note alias=mykey

4.2 While app is running in emulator, take 2 screenshots, paste to Paint, resize to 320 x 480

4.2 Get some other 512 x 512 image(You may need other image sizes, too)

4.3 Go back to Android Market and click “Upload Application”

4.4 Upload all the files, click Publish.

Page 24: DISTRIBUTING NATIVE MOBILE APPS

And that is distribution, in a nutshell