Flutter & Dart 캐시 정리 스크립트
sh 파일로 만들어서 프로젝트 폴더에 이동, 터미널에서 실행하면 ios 관련 재설정을 하게 됩니다.
- 파일을 만든다. 예시) 파일명 clean_ios_all.sh
#!/usr/bin/env bash
set -e # 오류 발생 시 즉시 중단
echo "1) Flutter & Dart 캐시 정리"
flutter clean
flutter pub get
echo "2) iOS Pods + Symlinks 제거"
rm -rf ios/Pods ios/.symlinks ios/Flutter/Flutter.framework
echo "3) CocoaPods 전역 캐시 비우기"
pod cache clean --all
echo "4) Pod 재설치"
cd ios
pod deintegrate # Podfile.lock까지 깨끗하게
pod install --repo-update
cd ..
echo "5) Xcode DerivedData 전체 삭제"
rm -rf ~/Library/Developer/Xcode/DerivedData/* # 안전 ― Xcode가 자동 재생성 :contentReference[oaicite:2]{index=2}
echo "6) (선택) 시뮬레이터 초기화"
# xcrun simctl erase all # 주석 해제 시 모든 시뮬레이터 데이터 초기화
echo "💡 캐시 초기화 완료 — 이제 flutter run / flutter build ipa 수행"
2. 파일에 실행권한을 준다. chmod +x clean_ios_all.sh
3. 터미널에서 ./clean_ios_all.sh
를 실행한다.
4. flutter build ipa --export-method ad-hoc
명령어로 ipa파일을 만든다.
5. 테스트 iphone 을 usb 연결해서 xcode 열어서

위에 4번을 실행 뒤에 build > ipa 폴더에 ipa가 만들어진다. vscode에서

finder 와 xcode 를 열어서

파일을 옮겨서 설치 해줍니다.
6. 이렇게 하면 실제 디바이스에서 앱을 테스트 할 수 있게 됩니다.