Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

ubuntu - PhoneGap, PhoneGap Build and iOS - Mac needed?

firstly I have reviewed previous similar questions, but there were either old and or contradictory in their answers, so I’m asking what is the current (May ’14) requirements to build/test/deploy iPhone/iPad apps?

Longer version – I’ve been asked by a client to develop an app for iOS/Android and as I’m completely new to this I was hoping to use PhoneGap to use my existing web skills to develop the apps. I currently just own an Android phone so installed the Android SDK and PhoneGap onto Ubuntu (everything download this week inc Ubuntu so all current versions) and eventually got the PhoneGap “hello world” example to run on the emulator and actual phone (not via play store, just local copy of APK file)

I’ve found many guides here and elsewhere detailing how you can publish to App Store using a PC (or Ubuntu I assume) – mostly talking about certs etc. But, from my experience of setting up my tools to build my first hello world app, PhoneGap requires the SDKs for each device you target, so would thus require the Apple SDK to enable you to run an emulator? Or can you emulate an iPhone on Ubuntu?

So it seems to me, that even thought you can deploy to the App Store without a Mac, you will need one during development to run the emulator – is this correct or what am I missing?

Thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Short answer: You don't need to have the iOS SDK on Ubuntu (nor could you anyway). build.phonegap.com takes care of that for you. There don't seem to be iOS emulators for Ubuntu but there may be some online services that you can leverage. But I believe you still need a Mac to publish to the app store.

Long answer:

You will need:

  • An Apple Developer account for the certificate files
  • You probably need an iOS device for testing. There don't seem to be iOS emulators for Ubuntu though there may be some good online services. (Some good threads on this: 1, 2) See Kerri's comment below highly recommending you test on a real device and not an emulator.

Here's how you would do it:

  1. Using your Apple Developer account, create a certificate and provisioning file in the Certificates, Identifiers & Profiles section.
  2. Create a .p12 file from the certificate. (You should be able to use OpenSSL but I'm not sure of the exact steps.)
  3. Register an account with build.phonegap.com.
  4. Create a signing key using your .p12 and provisioning files.
  5. Upload your code and build.phonegap.com will create the .ipa file for you.
  6. If you use an iOS device for testing, you can browse to build.phonegap.com on the device and install the app from there.
  7. To publish to the app store I believe you still need a Mac with Xcode. (Maybe there's a 3rd party service that does this but I couldn't find any.) An alternative to buying a Mac is to buy just the OS and either dual boot or create a virtual machine.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...