ディレクトリ移動しプロジェクトの直下に移動してください
cd Documents/XXX
下記を実行するとpodファイルがプロジェクト配下にできる
pod init
Podfileをエディターで修正
下記のようにPodfileを修正
※今回はAdmobを入れたい
platform :ios, '15.0'
target 'XXX' do
use_frameworks!
pod 'Google-Mobile-Ads-SDK'
end
修正後下記実行
pod update
Info.plist
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>
<key>UIApplicationSceneManifest</key>
AppDelegateクラス
import GoogleMobileAds
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
MobileAds.shared.start(completionHandler: nil)
return true
}
}
Sandbox: bash(4170) deny(1) file-write-create /Users/admin/Documents/GitHub/shitumonbakobako/Pods/resources-to-copy-shitumonbakobako.txt
下記エラー対応
Sandbox: bash(4218) deny(1) file-write-create /Users/admin/Documents/GitHub/xxx/Pods/resources-to-copy-xxx.txt
ENABLE_USER_SCRIPT_SANDBOXING を No