LoginSignup
3
1

More than 5 years have passed since last update.

Appium用に、fastlaneでappファイルを生成する

Posted at

AppiumでiOSのテストを行う場合、.appファイルが必要なようです。

fastlaneのgymの説明( https://github.com/fastlane/fastlane/tree/master/gym )には、

It takes care of all the heavy lifting and makes it super easy to generate a signed ipa or app file :muscle:

とあったのですが、appを作る方法が見当たらず。。。

結局、xcodebuildで出来ました。

Fastfile
SCHEME_NAME_DEV = 'develop'

platform :ios do
  lane :make_app do
    xcodebuild(
      scheme: SCHEME_NAME_DEV,
      build: true,
      sdk: 'iphonesimulator',
      derivedDataPath: 'build'
    )
  end
  # ...

SCHEME_NAME_DEVには、生成対象としたいスキーマを指定します。

これにより、build/Build/Products/Develop-iphonesimulator/(アプリ名).appにappファイルが作成されます。

RubyでAppiumのスクリプトを書いている場合、下記のように指定できます。

    desired_caps = {
      caps: {
        deviceName:   'iPhone Simulator',
        platformName: 'iOS',
        app:          '../project_dir/build/Build/Products/Develop-iphonesimulator/application_name.app'
      },
      appium_lib: {
        wait: 10
      }
    }
    @appium_driver ||= Appium::Driver.new(desired_caps)

これで、iOSのAppium始められる :muscle:

3
1
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
3
1