Skip to content

Instantly share code, notes, and snippets.

@hboon
Last active December 17, 2015 00:39
Show Gist options
  • Save hboon/5522694 to your computer and use it in GitHub Desktop.
Save hboon/5522694 to your computer and use it in GitHub Desktop.
env = if ENV['dev'] == '1'
'dev'
elsif ENV['adhoc'] == '1'
'adhoc'
else
'dev' #default
end
if env == 'dev'
app.codesign_certificate = 'iPhone Developer: Hwee Boon Yar (something)'
app.provisioning_profile = 'full path to mobileprovision'
app.entitlements['get-task-allow'] = true
elsif env == 'adhoc'
app.codesign_certificate = 'iPhone Distribution: Hwee Boon Yar'
app.provisioning_profile = 'full path to mobileprovision'
app.entitlements['get-task-allow'] = false
end
@bensheldon
Copy link

This uses some of the built in RubyMotion environment methods:

Motion::Project::App.setup do |app|
  # `rake`, `rake simulator`, `rake device`
  app.development do
    app.codesign_certificate = 'iPhone Developer: Hwee Boon Yar (something)'
    app.provisioning_profile = 'full path to mobileprovision'
    app.entitlements['get-task-allow'] = true
  end

  # `rake archive:distribution`
  app.release do
    app.entitlements['get-task-allow'] = false

    if ENV['adhoc'] 
      # can be entered in console with `adhoc=foo` or in a raketask with `ENV['adhoc']=true`
      app.codesign_certificate = 'iPhone Distribution: Hwee Boon Yar'
      app.provisioning_profile = 'full path to mobileprovision'
    else
      # certificate/profile for App Store release
    end
  end

end

@hboon
Copy link
Author

hboon commented May 6, 2013

This doesn't work for me though because the :testflight task uses :archive which according to https://github.com/HipByte/RubyMotion/blob/master/lib/motion/project.rb doesn't use :release. I assume that is because RubyMotion wants to retain symbols for debugging?

So TestFlight builds will trigger app.development and not get the right code-sign configuration.

All in all, app.development and app.release seems very strange though. I'm not sure it's designed for the right purpose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment