LoginSignup
1
0

More than 1 year has passed since last update.

XCode12でCarthageから取得したRealmを使用する

Posted at

Xcode12ではcarthage でライブラリの管理をしようとしたとき
carthage update --platform ios --use-xcframeworks
で.xcframeworksを取得してくることで可能だがRealmだと上のコマンドを使用しても.frameworkが取得されていて

無理やりだがgitからRealm.xcworkspaceとダウンロードしてきて手動で設定する必要があった

carthageが 0.38.0にバージョンアップしたことで解消されていたので
対応を記載

carthage version up

$ carthage version
0.37.0

$ brew upgrade carthage
...

$ carthage version
0.38.0
$ carthage update --platform ios --use-xcframeworks
・・・
*** Building scheme "Realm iOS static" in Realm.xcworkspace
*** Building scheme "Realm" in Realm.xcworkspace
*** Building scheme "RealmSwift" in Realm.xcworkspace

xcode

[Frameworks, Libraries, and Embedded Content]
にRealm.xcframeworkとRealmSwift.xcframeworkを設定
※ Embedには「Embed & Sign」を設定する

スクリーンショット01.png

Run ScriptのInputFilesからframeworkを削除
スクリーンショット 02.png

で完了

後書き

すでにアプリ審査ではXcode 12でのビルドが必須になっているため
Realmを使用する際はpodやSwift Package Manager へ移行する方が良いのかもしれないが
carthageを使うことでビルドに時間が掛からなくなるのはやっぱり魅了的なので、
重いものをcarthageで使うのは個人的にはありだとは思う

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