9
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iOSアプリをCircleCIにのせる

Posted at

ゴール

Circle CIでiOSアプリのビルドを通すまで
(2018/01/04現在)

はじめに

  • この資料はCircleCI2.0をもとに記載しています
  • CircleCIのドキュメントはこちら

Github Marketplace

Fastlaneの導入

  • Fastlaneの導入が必要

Gemfile

source "https://rubygems.org"

gem "fastlane"

Fastfile

基本fastlane initでできるものでOK

.circleci/config.yml

  • Project > Add Project > macOS > Setup Project からプロジェクトの設定を行う
  • .circleci/config.ymlは基本sample.ymlでOK
# iOS CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/ios-migrating-from-1-2/ for more details
#
version: 2
jobs:
  build:

    # Specify the Xcode version to use
    macos:
      xcode: "9.0"

    steps:
      - checkout
      - run: bundle install

      # Install CocoaPods
      # Fastfileで指定しているなら不要
      - run:
          name: Install CocoaPods
          command: pod install

      # Build the app and run tests
      - run:
          name: Build and run tests
          command: bundle exec fastlane test

      # プロジェクトの設定に合わせて変える
      - store_test_results:
          path: test_output/report.xml  
      - store_artifacts:
          path: /tmp/test-results
          destination: scan-test-results
      - store_artifacts:
          path: ~/Library/Logs/scan
          destination: scan-logs

はまりポイント

rubyのバージョンが違う

fastlaneはchrubyとruby-installでバージョン管理されているので、バージョン指定が必要な場合は.ruby-versionファイルが必要

iOS Simulatorが出ない

▸ xcodebuild: error: Unable to find a destination matching the provided destination specifier:
▸ { platform:iOS Simulator, id:91B6A3EF-A462-462C-BAD2-1F377D1A3B8A }

みたいなのが出るときは、Deployment Targetを指定する。(2018/01/04現在)

9
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?