3万円くらいでiOS開発環境を整える方法('23/12時点)

# 結論

16G(以上)のUSBメモリ用意して中古のiMACに最新のmacOSとXCodeを入れる

- USBメモリ ➡ 32Gがamazonで500円くらいで買える
- iMAC ➡ 2014年くらいのだとリコレで30000円くらいで買える

# 背景
- iOSで手軽に色々やりたい
- UIに時間かけたくない
- お金もかけたくない

# 経緯
## Sonoma
Reactの環境を新しくしようと
[この辺](https://qiita.com/takubii/items/13eb2fff2d8850f55e7d)とか見て
やってみたがなんかXcodeが古いとか言われて動かない

mac買い替えだと、、、
ノートPCに60万超えってなんやねん

Windowsだって結局古いPCにインストール出来るようになったんだし
Linuxは当然古いPCで動く
macだけ動かないとか無いやろ
と思って調べて見ると、[OCLP](https://dortania.github.io/OpenCore-Legacy-Patcher/)とかいうのがあるらしい

手順は[このサイト](https://www.taikun-room.com/2022/10/how-to-install-macos-ventura-on-unsupported-mac.html)の通りにやった

で、SonomaにしてXcodeも最新の15.1がApp Storeからインストールできた。

一応法的にもセーフらしい

とりあえず単体で動いた
![ios_self_map.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2383810/4f3ec059-427a-d0f5-71c5-30305cf5824e.png)

## React Native
気を取り直してRNのインストールと実行

なんかビルドに失敗してる
```
ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (1 target)
    Target 'sample' in project 'sample' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription
Build description signature: 3e7642d9aa703f29aba3c661c3482a4a
Build description path: /Users/macmac/Library/Developer/Xcode/DerivedData/sample-dcfafkuegajhrndlyelewzidpqge/Build/Intermediates.noindex/XCBuildData/3e7642d9aa703f29aba3c661c3482a4a.xcbuilddata

/Users/macmac/workspace/react/sample/ios/Pods/Target Support Files/Pods-sample/Pods-sample.debug.xcconfig:1:1: error: unable to open configuration settings file
warning: Unable to read contents of XCFileList '/Target Support Files/Pods-sample/Pods-sample-frameworks-Debug-output-files.xcfilelist' (in target 'sample' from project 'sample')
warning: Unable to read contents of XCFileList '/Target Support Files/Pods-sample/Pods-sample-resources-Debug-output-files.xcfilelist' (in target 'sample' from project 'sample')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'sample' from project 'sample')
error: Unable to load contents of file list: '/Target Support Files/Pods-sample/Pods-sample-frameworks-Debug-input-files.xcfilelist' (in target 'sample' from project 'sample')
error: Unable to load contents of file list: '/Target Support Files/Pods-sample/Pods-sample-frameworks-Debug-output-files.xcfilelist' (in target 'sample' from project 'sample')
warning: Run script build phase '[CP] Embed Pods Frameworks' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'sample' from project 'sample')
error: Unable to load contents of file list: '/Target Support Files/Pods-sample/Pods-sample-resources-Debug-input-files.xcfilelist' (in target 'sample' from project 'sample')
error: Unable to load contents of file list: '/Target Support Files/Pods-sample/Pods-sample-resources-Debug-output-files.xcfilelist' (in target 'sample' from project 'sample')
warning: Run script build phase '[CP] Copy Pods Resources' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'sample' from project 'sample')

** BUILD FAILED **
```
[これ](https://qiita.com/isaatsu0131/items/7438462abd65698a051a)の通りに実施すると、、、

動いた
![reactnative.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2383810/96fb06b6-2e4d-9abb-2932-b72f89a1bf6a.png)




# その他
Androidは試してません。
iOSより面倒ってことはないでしょう。多分

Rubyは3.3.0を使いました

![sonoma.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2383810/01fa545c-1cc3-ae74-3c70-585ba3fe7c8e.png)

----
# 参考
https://qiita.com/takubii/items/13eb2fff2d8850f55e7d
https://www.taikun-room.com/2022/10/how-to-install-macos-ventura-on-unsupported-mac.html
https://qiita.com/isaatsu0131/items/7438462abd65698a051a