infinitered / redpotion

We believe iPhone development should be clean, scalable, and fast with a language that developers not only enjoy, but actively choose. With the advent of Ruby for iPhone development the RubyMotion community has combined and tested the most active and powerful gems into a single package called RedPotion
MIT License
233 stars 40 forks source link

What to set for codesign_certificate? #119

Closed andrewhavens closed 9 years ago

andrewhavens commented 9 years ago

Sorry, I'm new to building RubyMotion apps. I see in the generated Rakefile that RedPotion sets some sample values for codesign_certificate and provisioning_profile:

  app.release do
    app.entitlements['get-task-allow'] = false
    app.codesign_certificate = 'iPhone Distribution: YOURNAME'
    app.provisioning_profile = "signing/myapp.mobileprovision"
    app.entitlements['beta-reports-active'] = true # For TestFlight

    app.seed_id = "YOUR_SEED_ID"
    app.entitlements['application-identifier'] = app.seed_id + '.' + app.identifier
    app.entitlements['keychain-access-groups'] = [ app.seed_id + '.' + app.identifier ]
  end

I didn't find any documentation on this in the RedPotion docs but it would be really helpful for newcomers like me. I managed to work my way through the Apple Dev Center and iTunes Connect to generate a .certSigningRequest, .cer, and .mobileprovision files. Now I'm trying to build and push to iTunes Connect for Test Flight distribution.

It looks like RedPotion is looking for my provisioning profile in a signing directory which was not generated, so I created one and moved the file there. Seems like maybe this directory should be automatically created and added to the .gitignore file, but maybe there's a reason that it is not. So now what do I set for codesign_certificate? Am I supposed to put my name/email in the YOURNAME placeholder? Or am I supposed to point to the .cer file?

Also I'm not sure what the seed_id option is for. I might run into that issue next. Some comments in the Rakefile would be helpful, or a page on the documentation site (which has been super helpful by the way!).

Any help you can provide would be greatly appreciated. Thanks!

sajoku commented 9 years ago

@andrewhavens In short you want to add the .cer file to your keychain and reference your developer name in the codesign_certificate. app.codesign_certificate = 'iPhone Developer: Your Name (XXXXXXXXXX)'

But read through this how to http://paulsturgess.co.uk/blog/2013/05/10/using-rubymotion-to-provision-an-app-onto-your-iphone/ and you'll be up and running in no time :)

andrewhavens commented 9 years ago

Thanks, I eventually worked my way through it all. Here are some of the key things that were hard to figure out:

squidpunch commented 9 years ago

@andrewhavens I'm curious - why dont you want to use motion-appstore ?

andrewhavens commented 9 years ago

@squidpunch It doesn't work. I tried validating and uploading and it didn't return any output except when uploading to say that my password was wrong (which isn't true unless it's trying to use the wrong Apple ID).

squidpunch commented 9 years ago

@andrewhavens interesting, I use it on a regular basis without any issue! sounds like something with some digging around would be able to shake out the issue but perhaps a bit hard just replying comments back and forth :)

twerth commented 9 years ago

A page in the docs about this would be awesome Andrew.

squidpunch commented 9 years ago

:+1: to @twerth's suggestion!

andrewhavens commented 9 years ago

I figured it out my issue with motion-appstore. First issue was not using a certificate/profile for distribution. Once I got that sorted out, I was calling motion validate APP-ID assuming that APP-ID was the ID of my App (e.g. 987654). However, replacing with the email address associated with my Apple account solved the problem. It did not matter that my account is associated with multiple teams. I successfully uploaded a build using motion-appstore.

I am working on a doc page for provisioning and distribution right now. =]

jamonholmgren commented 9 years ago

I am working on a doc page for provisioning and distribution right now. =]

clap

squidpunch commented 9 years ago

thanks for documenting this @andrewhavens im going to close this issue as its solved and now also documented via #120