Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ commands:
ios:
desc: Run the iOS sample app in the simulator.
long_desc: |
Builds and runs the iOS sample app on a simulator.
Ensures CocoaPods are in sync, then builds and runs the iOS sample app on a simulator.

--local
Build against in-repo Swift SDK sources (runs pod install first).
Build against in-repo Swift SDK sources.
syntax:
optional: --local
run: cd platforms/react-native && pnpm sample ios "$@"
Expand All @@ -263,9 +263,14 @@ commands:
optional: --local
run: cd platforms/react-native && pnpm run pod-install -- "$@"
clean:
desc: Remove generated directories and stop sccache
desc: Remove generated directories, clean CocoaPods cache, and stop sccache
run: |
cd platforms/react-native
if (cd sample/ios && bundle exec pod --version >/dev/null 2>&1); then
(cd sample/ios && bundle exec pod cache clean --all)
else
echo "Skipping CocoaPods cache clean (pod unavailable; run dev up first)"
fi
pnpm module clean
pnpm sample clean
pnpm clean
Expand Down
2 changes: 1 addition & 1 deletion platforms/react-native/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CI uses the default (published) path naturally — no special flag handling. As

### Gotchas

- **iOS**: re-run `dev rn pod-install --local` (or drop the flag) after switching modes — CocoaPods caches resolution.
- **iOS**: `dev rn ios` runs `pod install` before launching, so dropping or adding `--local` will re-resolve the pods as needed. You can still run `dev rn pod-install [--local]` directly when you only want to refresh pods.
- **Android (CLI)**: covered automatically by the publish script — every `--local` run re-publishes the AAR before building.
- **Android (Android Studio)**: when running the sample via Android Studio's Run button after editing `platforms/android/lib/src/**`, run `platforms/react-native/scripts/publish_android_snapshot` once manually (with `USE_LOCAL_SDK=1`) or run `dev rn android --local` from a terminal to refresh `~/.m2/`.
- The flag affects **only the RN build**. The standalone Swift and Android SDK builds (`dev android build`, `swift build`, etc.) are unaffected.
Expand Down
2 changes: 1 addition & 1 deletion platforms/react-native/sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"android": "bash ./scripts/android",
"clean": "rm -rf node_modules ios/build ios/pods vendor",
"clean": "rm -rf node_modules ios/build ios/Pods vendor",
"clean:android": "(cd android && ./gradlew clean)",
"build:android": "bash ./scripts/build_android",
"release:android": "bash ./scripts/release_android",
Expand Down
9 changes: 4 additions & 5 deletions platforms/react-native/sample/scripts/ios
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

args=()
use_local=0
pod_install_args=()
for arg in "$@"; do
if [ "$arg" = "--local" ]; then
use_local=1
export USE_LOCAL_SDK=1
pod_install_args+=("--local")
else
args+=("$arg")
fi
done

if [ "$use_local" = "1" ]; then
(cd "$SCRIPT_DIR/../.." && pnpm run pod-install -- --local)
fi
(cd "$SCRIPT_DIR/../.." && pnpm run pod-install -- "${pod_install_args[@]}")

exec react-native run-ios "${args[@]}"
4 changes: 1 addition & 3 deletions platforms/react-native/scripts/pod_install
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ for arg in "$@"; do
done

cd sample/ios
bundle install
bundle exec pod repo update
bundle exec pod cache clean --all
bundle check || bundle install
bundle exec pod install --repo-update
Loading