docs(ios): update README for simulator setup and build instructions

- Translated and reorganized instructions for running the app on the iOS simulator.
- Added specific commands for terminal usage and emphasized the importance of executing commands from the correct project directory.
- Removed outdated sections and streamlined the content for clarity and relevance.

This update enhances the documentation for developers working with the iOS simulator.
This commit is contained in:
2026-05-25 15:33:37 +03:00
parent 7779803ccc
commit bb49bbd0f7

View File

@@ -1,54 +1,23 @@
# iOS # Запуск на симуляторе (Mac)
Flutter + CocoaPods. Нативка через плагины — зависимости смотри в `Podfile` / `Podfile.lock`. **Терминал** (⌘ + `):
## Окружение
Полный Xcode (не только CLT). После апдейта Xcode:
```bash ```bash
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer cd /Users/commercesparkit.by/Desktop/projekt/be_happy_public
sudo xcodebuild -runFirstLaunch export LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
open -a Simulator
flutter run
``` ```
Нет нужного iOS в сборке — Xcode → Settings → Platforms, докачать runtime. `flutter doctor -v` для быстрой проверки toolchain. Первый раз или после обновления кода:
## Сборка из репозитория
Из корня (важно для `Generated.xcconfig`):
```bash ```bash
cd /Users/commercesparkit.by/Desktop/projekt/be_happy_public
export LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
flutter pub get flutter pub get
cd ios && pod install && cd .. cd ios && pod install && cd ..
open -a Simulator
flutter run
``` ```
Открывать **`Runner.xcworkspace`**, не `Runner.xcodeproj`. Важно: команды только из папки `be_happy_public`, не из `~`.
Ключ **Yandex MapKit**: в `Info.plist``YandexMapKitApiKey` = `$(YANDEX_MAPKIT_API_KEY)`. Значение задаётся в `ios/Flutter/Debug.xcconfig`, `Release.xcconfig`, `Profile.xcconfig` (в конце файла; опционально перед этим `#include? "Secrets.xcconfig"` — см. `Secrets.xcconfig.example`). В `AppDelegate.swift` до `super.application` вызываются `YMKMapKit.setLocale` / `setApiKey` из plist — иначе SDK падает при регистрации плагина.
## Подпись
Runner → Signing & Capabilities, свой Team. Bundle id: `com.sparkit.beHappy` — должен совпадать с App ID в developer portal под TestFlight / App Store.
## Артефакты
```bash
flutter build ipa
```
`.ipa` — в `build/ios/ipa/` (точный путь Flutter печатает в конце).
Альтернатива: Xcode → Archive → Distribute. `ExportOptions.plist` в репу не коммитим.
## Симулятор
```bash
flutter devices
flutter run -d <device_id>
```
У `mobile_scanner` 5.x в Pods тянется Google ML Kit; на симуляторах Apple Silicon под свежим iOS Xcode часто ругается на arm64 и криво матчит destination. Если `flutter run` на симе отвалился — собери на **физическом устройстве** или проверь обновления плагина / обходы в `Podfile` под твою связку Xcode + runtime.
## Ссылки
[Flutter: iOS deployment](https://docs.flutter.dev/deployment/ios)