1
2

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 1 year has passed since last update.

Xcode ProjectをRenameする方法

Posted at

Screen Shot 2022-01-07 at 0.29.08.png

概要

XcodeをRenameするとき、1箇所を変えるだけでXcodeが全て置き換えてくれるわけではなく、手作業が必要なので、その手順を記す。
今回は通常のProjectでCocoaPodsやCarthageなどは使用していないProjectになります。(後日追記予定)

#手順
例としてAppleというProjectがあります。

Screen Shot 2022-01-06 at 23.56.11.png

Step1

変更したいProjectのNavigator AreaにあるProjectのIconを選択してFile Inspectorから名前を変更します

今回はApple -> Strawberryに変更します

Screen Shot 2022-01-07 at 0.01.18.png

その時にこのような確認画面ができまのでRenameを押します。

Screen Shot 2022-01-06 at 23.59.45.png

警告が出ますが、ここもContinueで構いませんが、Backupなどをとっておきたい場合にはcommitしておくことをお勧めします。

Screen Shot 2022-01-06 at 23.59.59.png

変更が完了したら、Project上部のSchemeからManage Schemeを選択して名前を変更します。

Screen Shot 2022-01-07 at 0.11.25.png

Step2

Projectを閉じて、Xcodeを終了します。
Projectディレクトリにある旧Project名と同じ部分をRenameします。

Screen Shot 2022-01-07 at 0.17.03.png

Renameが完了したら再度Projectを開きます

開くと名前を変更したため、このような状態になっていると思います

Screen Shot 2022-01-07 at 0.21.05.png

開いた後、Renameしたフォルダを選択して、FileInspectorからLocation横にあるとフォルダアイコンのボタンから再度選択すると

Screen Shot 2022-01-07 at 0.26.13.png

フォルダが存在する状態に戻ります。

Screen Shot 2022-01-07 at 0.26.58.png

FileInspectorに再び戻り、Nameを新しいStrawberryに変更します。
これを全ての変更したところに適用することで変更が完了します。

Screen Shot 2022-01-07 at 0.29.08.png

Step2

projectからBuild Settingを選択して、plistで検索します。
出てきたPackagingのinfo.plist FileとProduct Bundle identifierを変更します。

Screen Shot 2022-01-07 at 0.34.53.png

TestsやUITestsを作成している場合には同じように変更します。
ここまでで基本的なProjectだと変更完了になりますが、例えばBridging-Headerなど何か設定している場合には必ず変更が必要になりますので、検索などを使って旧ProjectNameが残っていないかを確認することをおすすめします。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?