Detailed Guide for setting up building iOS apps without a Mac

  • 25
  • Idea
  • Updated 4 years ago
I just did a successful build and run using this workflow - it has been described in summary as a response to this question:

http://community.phonegap.com/nitobi/...

This is a more detailed step-by-step guide of the process.

1. Download and Install OpenSSL

Download and install OpenSSL for Windows 32 bit from this location:

http://www.slproweb.com/products/Win3...

(You may need to install the VC2008 32 Bit Redistributables as well)

For the remainder of this guide, it's assumed you have installed OpenSSL into

C:\OpenSSL-Win32

which is the default location. I opted to have the binaries installed in the OpenSSL folder after the installer hung on selecting the Windows System directory as a destination (using W7 64).

2. Create a working folder to hold all the certificate files and open a command prompt to that folder.

3. On the command prompt, enter the following to create a key file:

C:\OpenSSL-Win32\bin\openssl genrsa -out mykey.key 2048

4. On the command prompt, enter the following to create a Certificate Signing Request:

C:\OpenSSL-Win32\bin\openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest -subj "/emailAddress=email@address.com, CN=Your Name, C=US"

Replace email address & name by your own and C=US by your country code if needed.

5. Upload the Certificate Signing Request to the Apple Developer Site on

http://developer.apple.com/ios/manage...

Refresh the page after a few moments and your CSR should be accepted.

6. Click the Download link listed next to your accepted certificate.

This will download the developer_identity.cer file. Store it in the folder you created earlier.

7. On the command prompt, enter the following to convert from .cer to .pem:

C:\OpenSSL-Win32\bin\openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM

8. On the command prompt, enter the following to create the .p12 file

C:\OpenSSL-Win32\bin\openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out iphone_dist.p12

You will be asked to enter a password and confirm it. This password will need to be re-entered when submitting the .p12 file to PhoneGap Build.

9. On the Apple Developer Site, set up your devices, app id and provisioning:

https://developer.apple.com/ios/manag...
https://developer.apple.com/ios/manag...
https://developer.apple.com/ios/manag...

and download the provisioning file, store it in the folder created earlier

10. Upload both the provisioning and the .p12 files to PhoneGap Build:

https://build.phonegap.com/people/edi...

and provide the password you used before to build the .p12 file.

11. Set your config.xml widget id to the same value as your app id in the Apple developer site.

Note: the Apple app id format is something like

67AQJRV39J.com.okeez.connecttest

I set the widget ID to the entire value, but that seems to have broken my Android build (get error there now where before it built OK).

HTH
Photo of OKeez

OKeez

  • 25 Posts
  • 0 Reply Likes

Posted 9 years ago

  • 25
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
This looks good.

Note that your app id doesn't need to match your app id's prefix - "com.okeez.connecttest" would be a valid identifier with that cert and profile.
Photo of OKeez

OKeez

  • 25 Posts
  • 0 Reply Likes
Your reply and my mail on this seem to have crossed paths ;)

I changed the package name as this was described here as necessary, but I misinterpreted the scope of the package name that was meant.

https://build.phonegap.com/docs/ios-b...

Thank you again for the quick response.
Photo of James Ivings

James Ivings

  • 19 Posts
  • 1 Reply Like
This is excellent. Goodbye Mac! Thanks a lot OKeez.
Photo of Massimo Fanti

Massimo Fanti

  • 25 Posts
  • 0 Reply Likes
Can i build ipa (only for debugging) with apple developer free program? Must i pay 99/year if i only want to do some test for myself?

Thanks!
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
You will have to be a member of Apple's Developer program - either pay the $99, or get a job at a company that will pay it for you :)
Photo of Massimo Fanti

Massimo Fanti

  • 25 Posts
  • 0 Reply Likes
ok!

Thanks!
Photo of Massimo Fanti

Massimo Fanti

  • 25 Posts
  • 0 Reply Likes
Another question.

Can i upload to appstore an app (made with PhoneGap Build) by Windows??? Must i need a mac????
Photo of OKeez

OKeez

  • 25 Posts
  • 0 Reply Likes
Yes, you can upload an .ipa with a Windows machine, and the mechanism I described above for creating and converting keys works for provisioning distributions. I haven't created a release distribution with this mechanism yet.
Photo of Massimo Fanti

Massimo Fanti

  • 25 Posts
  • 0 Reply Likes
Thanks for reply.

So..i don't have a mac...i follow your steps and i have a .ipa build and certified...so...now...how can i upload it to appstore? :)
Photo of Massimo Fanti

Massimo Fanti

  • 25 Posts
  • 0 Reply Likes
I try make certificate but i receive this error:

C:\OpenSSL-Win32\bin>openssl req -new -key mykey.key -out CertificateSigningRequ
est.certSigningRequest -subj "/emailAddress=xxx@xxx.com, CN=XXX XXX, C=US"

WARNING: can't open config file: /usr/local/ssl/openssl.cnf
Unable to load config info from /usr/local/ssl/openssl.cnf
Photo of jvfrance

jvfrance

  • 28 Posts
  • 0 Reply Likes
Type in this at the command prompt:

set OPENSSL_CONF=c:\[PATH TO YOUR OPENSSL DIRECTORY]\bin\openssl.cfg
This will correct the error.

Jim
Photo of Brad Greenwald

Brad Greenwald

  • 1 Post
  • 0 Reply Likes
I tried this while running PowerShell as Administrator and added it to my path. Still got the error. After an hour it turns out I needed to restart my Win7/64 box and then the PATH var began working. Just documenting here in case anyone else encounters that.
Photo of gilles faessler

gilles faessler

  • 1 Post
  • 0 Reply Likes
Be beware on the double quotes format " vs “
Photo of OKeez

OKeez

  • 25 Posts
  • 0 Reply Likes
I'm no expert on OpenSSL but that doesn't look like an error message I'd expect from an installed OpenSSL Windows version (/usr/local/...).

Did you download an OpenSSL installer or a zip file?

http://www.slproweb.com/products/Win3...
Photo of Massimo Fanti

Massimo Fanti

  • 25 Posts
  • 0 Reply Likes
No no, installer WIn 32 bit.

I have your same problem...hang before terminate...also in bin folder...
Photo of Massimo Fanti

Massimo Fanti

  • 25 Posts
  • 0 Reply Likes
Solved: i installed openssl under xpmode system...works. :)

Now...how can i upload on appstore my app without a mac? is it possible?

Thanks again!
Photo of gkatz

gkatz

  • 186 Posts
  • 5 Reply Likes
is this still valid? looks like you can only submit binary apps through the 'application loader' application on mac OS X...
Photo of Jeremy Hoke

Jeremy Hoke

  • 3 Posts
  • 3 Reply Likes
For those of you getting the following error:

WARNING: can't open config file: /usr/local/ssl/openssl.cnf
Unable to load config info from /usr/local/ssl/openssl.cnf

This worked for me on Windows XP:

http://www.mail-archive.com/openssl-u...

In a command window type:

set OPENSSL_CONF=c:\openssl\openssl.conf

change "c:\openssl\openssl.conf" to the path of your configuration file.
Photo of Andre

Andre

  • 1 Post
  • 0 Reply Likes
Thanks
Photo of michael.tamony

michael.tamony

  • 17 Posts
  • 1 Reply Like
Can you discuss how you loaded your app onto the iOS device? I am looking at TestFlight, but it would be nice to know what people use.

Thanks.
Photo of annielhy

annielhy

  • 5 Posts
  • 0 Reply Likes
If you are based on Phonegap Build. Use you QR Code reader to loader the .ipa (for debugging) to you device. iTune is not needed.
Photo of yogiwaits

yogiwaits

  • 2 Posts
  • 0 Reply Likes
My app is getting built fine in phone gap but when i install it on IPad it deosnt fit properly, It kind of tilts towards left and my left pane is cut off. Seems like hasnt built correctly. After reading your documentation here i saw i havent used the package name. Phone gap took the name itself (i.e. com.phonegap). I have my apple id as M8585P4E.keeer.yogeeh.* (i have changed the few letters in the first part for privacy). What should be my package name. Can you or anyone can tell me please. It is kind of urgent. Please help
Photo of BLE

BLE

  • 4 Posts
  • 0 Reply Likes
Photo of James Robinson

James Robinson

  • 3 Posts
  • 0 Reply Likes
I am also getting this error. What is the correct URL?
Photo of James Robinson

James Robinson

  • 3 Posts
  • 0 Reply Likes
Found it. Here's the updates instructions for steps 5 and 6:

5. Upload the Certificate Signing Request to the Apple Developer Site on

https://developer.apple.com/ios/manag...

Refresh the page after a few moments and your CSR should be accepted.

6. Click the Download link listed next to your accepted certificate.

This will download the ios_development.cer file. Store it in the folder you created earlier.
Photo of James Robinson

James Robinson

  • 3 Posts
  • 0 Reply Likes
Also note new instructions for steps 7 and 8. Note that i'm using the 64bit versions of OpenSSL. If you're using the 32bit, then just change the number "64" to "32".

7. On the command prompt, enter the following to convert from .cer to .pem:
C:\OpenSSL-Win64\bin\openssl x509 -in ios_development.cer -inform DER -out ios_development.pem -outform PEM

8. On the command prompt, enter the following to create the .p12 file

C:\OpenSSL-Win64\bin\openssl pkcs12 -export -inkey mykey.key -in ios_development.pem -out iphone_dist.p12

You will be asked to enter a password and confirm it. This password will need to be re-entered when submitting the .p12 file to PhoneGap Build.
Photo of ApacheOmega

ApacheOmega

  • 8 Posts
  • 0 Reply Likes
step 8 - it wont let me enter a password in fact it wont even let me type in that field for some reason
Photo of Danny Cutts

Danny Cutts

  • 1 Post
  • 0 Reply Likes
I have this same error....
Photo of BLE

BLE

  • 4 Posts
  • 0 Reply Likes
The step 10 link didn't work but this did: https://build.phonegap.com/people/edi...
Photo of Benjamin P. Dorsi-Todaro

Benjamin P. Dorsi-Todaro

  • 55 Posts
  • 1 Reply Like
I would like to say thank you so much for this great tutorial. It was written very well. And because of the tutorial I was able to make a program that helps in automating all of the stuff. So you don't need to type all those commands in.

My iOS Signing Program

The only thing you need for the program is to install the OpenSSL program mentioned in the tutorial. Also please keep in mind that I built the program in one night. So if enough people like it I will work on improving it.
Photo of vespino

vespino

  • 132 Posts
  • 3 Reply Likes
Is this tool still available?
Photo of BLE

BLE

  • 4 Posts
  • 0 Reply Likes
Hi Ben,

You may want to consider open sourcing your utility since most people don't trust random exe downloads from forums.
Photo of Benjamin P. Dorsi-Todaro

Benjamin P. Dorsi-Todaro

  • 55 Posts
  • 1 Reply Like
I've added the source code as well as the executable to source forge under the GNU General Public license. You can check it out here if your interested.
Photo of Benjamin P. Dorsi-Todaro

Benjamin P. Dorsi-Todaro

  • 55 Posts
  • 1 Reply Like
BLE have no problem Open Sourcing my software. Alot of my software is already open sourced and on Source Forge, CNET, Softpedia and other sources. When making this small program I had big goals.

To have a open source community project called Fruitless. Which it primary goal would be to be able to create and submit iOS App to the Apple App Store without having an Apple computer.

This would mean we would need a development language such as phonegap and HTML5. An Emulator, most likely a BSD derivative running on QEMU and also using Open Darwin.

I'm so serious about getting this project up and running I even purchased an Apple computer, as well as an iPhone so I can start getting a better idea of how these things work.

Another thing that will be needed is an Open Source uploader. However I have been getting some errors when using Apples Uploader so this is somewhat of a problem.

Let me do some touch up's on the program and I will submit both the source code and binaries to Source Forge.

I built the program with .Net Framework 4.5 but I want it to be compatible with older computers, so I most likely will downgrade the framework to 2.0
Photo of jellyfishquandry

jellyfishquandry

  • 4 Posts
  • 0 Reply Likes
Has anyone tried Mobundler.com as an alternative to OpenSSL for acquiring .p12 file?
Also, I'd be interested to here whether anyone had followed the steps above and successfully got their app on sale.
Cheers,
Mike.
Photo of Benjamin P. Dorsi-Todaro

Benjamin P. Dorsi-Todaro

  • 55 Posts
  • 1 Reply Like
At this point in time that appears to be correct. At least I have yet to find a way to submit an app to the App Store without a Mac.

Also it sounds as though your complaining. If your complaining please don't. You will get no where except drawing attention to yourself.

Phone Gap is a great tool to many people. But it didn't become great over night and it didn't become great with people complaining. It became great because instead of Adobe closing the source code and charging for it. They have opened it and let people contribute to it.

People who have contributed are the ones who have helped make it better. I will also state the Phone Gap plays by the rules. Hence no one will do something with Phone Gap that will violate the EULA to another company. The great part about this guide is that you can create an iOS signing certificate without violating the EULA. I'm not certain that would be the case with the App Loader.

If your not happy you can do several things other then complain.

1: Buy an Apple computer
2: Use a friends Apple computer
3: Find a way to submit the App to the App Store on a Windows computer (then share how you've achieved it on these forums.
4: Pay me enough money so I can quite my day job so I can build a program that will allow you to submit apps to the App Store from another OS. (On my spare time I'm currently working on a project to achieve just this goal)
5: Just don't use Phone Gap if your not happy.
Photo of jellyfishquandry

jellyfishquandry

  • 4 Posts
  • 0 Reply Likes
Thanks for the info. Sorry if sounded like I was complaining - I really wasn't - I was just trying to get it clear in my head. Apologies if it came across badly. I think Phonegap is great and Phonegap Build is a welcome step forward in app development. I also understand that the problem lies with Apple, not Phonegap.
As for my options:
1) Seriously considering getting a second hand one off Ebay when I've raised enough cash.
2) I don't know anyone who owns a Mac - seriously.
3) Discovered just how complicated this is over the last few days - not an option for me.
4) You build the program and I will buy it (as long as it's cheaper than a Mac)! Seriously I would be happy to pay for this software. Please let me know if / when you achieve this.
Thanks again,
Mike.
Photo of Benjamin P. Dorsi-Todaro

Benjamin P. Dorsi-Todaro

  • 55 Posts
  • 1 Reply Like
No problem. You may also want to consider looking into purchasing a mac in cloud account. If you think it may be more reasonable for you. Mac in Cloud is Mac OSX system that is all yours in the cloud. They charge for this though. They have subscription plans and pay as you go plans. It looks like the pay as you go is about $1.00 per hour of use.

Honestly once you install and configure your Mac Development software you wont need to be on for an hour to use the App Loader.

http://www.macincloud.com/
Photo of jellyfishquandry

jellyfishquandry

  • 4 Posts
  • 0 Reply Likes
Interesting.

Speaking of cloud access - let me know what you think of this: http://support.brightcove.com/en/app-...
Photo of Benjamin P. Dorsi-Todaro

Benjamin P. Dorsi-Todaro

  • 55 Posts
  • 1 Reply Like
Also I can tell you that be careful when buying a Mac. Theirs a bug with Phone Gap that makes it so you can't use the 1.5 App Loader with a Phone Gap app. The current versions of XCode won't work on anything older then Mac OSX 10.7 Lion.

You need the App Loader 2.5 or higher to upload an App to the iTunes Connect. It's a real pain to find the App Loader for older versions of Mac OSX that work with Phone Gap.

So just a heads up for you. Do your research. And the best bet is getting a mac that can support Mac OSX 10.7 or higher.

I'm not trying to make you pay more money. Justt\ speaking from personal experience.
Photo of Aiad

Aiad

  • 46 Posts
  • 2 Reply Likes
Hi, about saying ( You will be asked to enter a password and confirm it. This password will need to be re-entered when submitting the .p12 file to PhoneGap Build.) I have been not asked to enter a password while building .p12 file, does that mean I made some mistake through the building process?
Thanks