IOS Native Provisioning from Windows

sprocketexponentialΚινητά – Ασύρματες Τεχνολογίες

10 Δεκ 2013 (πριν από 3 χρόνια και 8 μήνες)

120 εμφανίσεις



IOS Native Provisioning from Windows




Brief theory on
Certificates

Certificates are related to public key cryptography by containing a

public key. To be useful, there must be a corresponding private key

somewhere. With OpenSSL, public keys are easily derived from private

keys, so before you create a certificate or a certificate request, you

need to create a private key.


Private keys are generated with 'openssl genrsa' if you want a RSA

private key, or '
openssl gendsa' if you want a DSA private key.

Further information on how to create private keys can be found in

another HOWTO <keys.txt?>. The rest of this text assumes you have

a private key in the file privkey.pem.



Creating a certificate request


To
create a certificate, you need to start with a certificate

request (or, as some certificate authorities like to put

it, "certificate signing request", since that's exactly what they do,

they sign it and give you the result back, thus making it authentic

ac
cording to their policies). A certificate request can then be sent

to a certificate authority to get it signed into a certificate, or if

you have your own certificate authority, you may sign it yourself, or

if

you need a self
-
signed certificate (because you just want a test

certificate or because you are setting up your own CA).


I assume you have a Apple developer account and if you go to the provisioning site

at
https://developer.apple.com/ios/manage/provisioningprofiles/index.action


and click on
certificates

it
should look like:


Now our first goal is to create this certificate so let’s get started:


Install

OpenSSL

http://slproweb.com/products/Win32OpenSSL.html

and install the windows 64 version
if appropriate
. Now generate the private key as follows:

openssl genrsa

out mykey.key 2048 mykey.key will
contain the private key





If you see the warning above one can get rid of
it by

setting
the location

of config file must be set
:

set OPENSSL_CONF=c:
\
[PATH TO YOUR OPENSSL DIRECTORY]
\
bin
\
openssl.cfg

then re issue the command:


Now we create
the signing request:


openssl req

new

key mykey.key

out certsigningreq.certSigningrequest


subj
“/emailAddress=jmcfet@bellsouth.net,CN=john mcfetridge,C=US”


So now we see the certsigningreq.certSigningrequest file that we will need for the next step.

Now return to the apple provisioning site certificate section and hit
request
certificate


button and
should see


Press the
Browse

and navigate to where we generated the signing request

which in my case is
c:/openssl/bin/


and select the
certsigningreq.c
ertSigningRequest

file
then
press

the
submit

and we are
returned to provisioning page .
W
ait a couple of
minutes and

refresh the page and should see:


Now we have a certificate signed with our pr
i
vate key and ready to be used. So press the download and
sa
ve the .cer file back into a known place on your HD. I chose openssl/bin

in my case.

Now
we need to create
the P12 file

using the certificate and there are 2 steps here
:


First generate the PEM file:

Openssl x509

in
ios_development.cer


inform DER

out
developer
.
pem

outform PEM


Now we can g
enerate the p12 (note at this step u will be asked for a password)

Openssl pkcs12

export

inkey mykey.key


in developer.pem

out iphone.p12

After all this my c:/openssl/bin looks like:






Apple Provisioning sit
e

Your target device must be setup which if my IPod Touch in this case. The device id was obtained from
iTunes.



An Appid must be setup:


And finally Provisioning:






Sencha config

{




"applicationName":"TouchStyle",


"applicationId":"
com.Sandkey.SenchaDevice",


"bundleSeedId":"B5G384F9Y9


"versionString":"1.0",



"iconName":"icon.png",



"inputPath":"C:/sencha
-
touch
-
2.0.1
-
rc/sencha
-
touch
-
2.0.1
-
rc/examples/touchstyle",




"outputPath":"C:/SenchaNative/ouchstyle",

//ignore when u use se
ncha app build
native



"configuration":"Debug",





"platform":"iOS",




"deviceType":"iPhone",





"certificatePath":"C:/OpenSSL/bin/iphone.p12",


"certificatePassword": "gogators",




"certificateAlias":"john Mcfetridge",






"androidAPILevel":"15",





"orientations": [



"portrait",



"landscapeLeft",



"landscapeRight",



"portraitUpsideDown"


]

}


Then navigate to the directory that contains the app we want to deploy in this case examples/touchstyle
and issue:

Sencha app build native




The app is
deployed to deploy/native/touchstyle and now we can drag and drop the
TouchStyle.app

folder onto the apps folder in iTunes. Everything looks good at this point:




Then sync the device and
sadly we
see



Then I changed the sencha config file

as Alex suggested

to add:


,


"provisionProfile":"mytest.mobileprovision",



But the Sencha app build failed