Coder Social home page Coder Social logo

orta / spaceship Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastlane-old/spaceship

2.0 3.0 0.0 1.49 MB

Ruby library to access the Apple Dev Center and iTunes Connect

Home Page: https://spaceship.airforce

License: MIT License

Ruby 99.84% HTML 0.16%

spaceship's Introduction


fastlane

deliversnapshotframeitPEMsighproducecertcodesspaceshippilotboardinggym

-------

-------

Twitter: @KauseFx License Coverage Status Gem Build Status

Get in contact with the developers on Twitter: @KrauseFx and @snatchev


Why?UsageInstallationTechnical DetailsNeed help?


spaceship is part of fastlane: connect all deployment tools into one streamlined workflow.

What's spaceship?

spaceship is a Ruby library that exposes both the Apple Developer Center and the iTunes Connect API. It’s super fast, well tested and supports all of the operations you can do via the browser. Scripting your Developer Center workflow has never been easier!

Up until now, the fastlane tools used web scraping to interact with Apple's web services. With spaceship it is possible to directly access the underlying APIs using a simple HTTP client only.

Using spaceship, the execution time of sigh was reduced from over 1 minute to less than 5 seconds.

spaceship uses a combination of 3 different API endpoints, used by the Apple Developer Portal and Xcode. As no API offers everything we need, spaceship combines all APIs for you. More details about the APIs.

More details about why spaceship is useful on spaceship.airforce.

No matter how many apps or certificates you have, spaceship can handle your scale.

Enough words, here is some code:

Spaceship.login

# Create a new app
app = Spaceship.app.create!(bundle_id: "com.krausefx.app", name: "Spaceship App")

# Use an existing certificate
cert = Spaceship.certificate.production.all.first

# Create a new provisioning profile
profile = Spaceship.provisioning_profile.app_store.create!(bundle_id: app.bundle_id,
                                                         certificate: cert)

# Print the name and download the new profile
puts "Created Profile " + profile.name
profile.download

Speed

How fast are tools using spaceship compared to web scraping?

assets/SpaceshipRecording.gif

Installation

sudo gem install spaceship

Usage

Playground

To try spaceship, just run spaceship. It will automatically start the spaceship playground. It makes it super easy to try spaceship 🚀

assets/docs/Playground.png

Apple Developer Portal API

Open DeveloperPortal.md for code samples

iTunes Connect API

Open iTunesConnect.md for code samples

Spaceship in use

Most fastlane tools already use spaceship, like sigh, cert, produce, pilot and boarding.

Full Documentation

The detailed documentation of all available classes is available on RubyDoc.

You can find the log file here /tmp/spaceship[time].log.

Technical Details

HTTP Client

Up until now all fastlane tools used web scraping to interact with Apple's web services. spaceship uses a simple HTTP client only, resulting in much less overhead and extremely improved speed.

Advantages of spaceship (HTTP client) over web scraping:

  • Blazing fast 🚀 90% faster than previous methods
  • No more overhead by loading images, HTML, JS and CSS files on each page load
  • Great test coverage by stubbing server responses
  • Resistant against design changes of the Apple Developer Portal
  • Automatic re-trying of requests in case a timeout occurs

API Endpoints

I won't go into too much technical details about the various API endpoints, but just to give you an idea:

  • https://idmsa.apple.com: Used to authenticate to get a valid session
  • https://developerservices2.apple.com:
  • Get a detailed list of all available provisioning profiles
  • This API returns the devices, certificates and app for each of the profiles
  • Register new devices
  • https://developer.apple.com:
  • List all devices, certificates, apps and app groups
  • Create new certificates, provisioning profiles and apps
  • Disable/enable services on apps and assign them to app groups
  • Delete certificates and apps
  • Repair provisioning profiles
  • Download provisioning profiles
  • Team selection
  • https://itunesconnect.apple.com:
  • Managing apps
  • Managing beta testers
  • Submitting updates to review
  • Manaing app metadata
  • https://du-itc.itunesconnect.apple.com:
  • Upload icons, screenshots, trailers ...

spaceship uses all those API points to offer this seamless experience.

Magic involved

spaceship does a lot of magic to get everything working so neatly:

  • Sensible Defaults: You only have to provide the mandatory information (e.g. new provisioning profiles contain all devices by default)
  • Local Validation: When pushing changes back to the Apple Dev Portal spaceship will make sure only valid data is sent to Apple (e.g. automatic repairing of provisioning profiles)
  • Various request/response types: When working with the different API endpoints, spaceship has to deal with JSON, XML, txt, plist and sometimes even HTML responses and requests.
  • Automatic Pagination: Even if you have thousands of apps, profiles or certificates, spaceship can handle your scale. It was heavily tested by first using spaceship to create hundreds of profiles and then accessing them using spaceship.
  • Session, Cookie and CSRF token: All the security aspects are handled by spaceship.
  • Profile Magic: Create and upload code signing requests, all managed by spaceship
  • Multiple Spaceship: You can launch multiple spaceships with different Apple accounts to do things like syncing the registered devices.

Credits

The initial release was sponsored by ZeroPush.

spaceship was developed by

Open full list of contributors.

Like this tool? Be the first to know about updates and new fastlane tools

License

This project is licensed under the terms of the MIT license. See the LICENSE file.

This project and all fastlane tools are in no way affiliated with Apple Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs. All fastlane tools run on your own computer or server, so your credentials or other sensitive information will never leave your own computer. You are responsible for how you use fastlane tools.

spaceship's People

Contributors

askl56 avatar christopherstott avatar dkhamsing avatar ferdinandrosario avatar fullsailor avatar henrinormak avatar kiranpanesar avatar krausefx avatar lacostej avatar lmirosevic avatar mathcarignani avatar neonichu avatar snatchev avatar tobiasstrebitzer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.