run on ios
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
"scheme": "mobile",
|
||||
"userInterfaceStyle": "automatic",
|
||||
"ios": {
|
||||
"icon": "./assets/expo.icon"
|
||||
"icon": "./assets/expo.icon",
|
||||
"bundleIdentifier": "<@var(context.project.bundleid)>"
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
@@ -18,7 +19,7 @@
|
||||
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
||||
},
|
||||
"predictiveBackGestureEnabled": false,
|
||||
"package": "com.gregorl.mobile"
|
||||
"package": "<@var(context.project.bundleid)>"
|
||||
},
|
||||
"web": {
|
||||
"output": "static",
|
||||
|
||||
@@ -40,6 +40,23 @@
|
||||
echo no | avdmanager create avd -n "Pixel_5_API34" -k "system-images;android-34;google_apis_playstore;${if pkgs.stdenv.hostPlatform.isAarch64 then "arm64-v8a" else "x86_64"}" -d "pixel_5"
|
||||
fi
|
||||
'';
|
||||
# macOS only: run on the iOS simulator when Xcode with a simulator is installed.
|
||||
scripts.run-ios = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
exec = ''
|
||||
# devenv points DEVELOPER_DIR at the Nix SDK, which xcode-select would echo back.
|
||||
dev_dir="$(/usr/bin/env -u DEVELOPER_DIR /usr/bin/xcode-select -p 2>/dev/null)"
|
||||
[ -x "$dev_dir/usr/bin/simctl" ] || dev_dir=/Applications/Xcode.app/Contents/Developer
|
||||
if ! DEVELOPER_DIR="$dev_dir" /usr/bin/xcrun simctl list devices available 2>/dev/null | grep -q iPhone; then
|
||||
echo "No Xcode iOS simulator found, skipping iOS."
|
||||
exit 0
|
||||
fi
|
||||
# devenv's Nix Apple SDK, xcrun and compiler wrappers break xcodebuild, so build in a clean env.
|
||||
exec /usr/bin/env -i HOME="$HOME" USER="$USER" TERM="$TERM" LANG=en_US.UTF-8 \
|
||||
DEVELOPER_DIR="$dev_dir" \
|
||||
PATH="${lib.makeBinPath [ pkgs.bun pkgs.nodejs_24 pkgs.cocoapods ]}:/usr/bin:/bin:/usr/sbin:/sbin" \
|
||||
bunx expo run:ios --no-bundler "$@"
|
||||
'';
|
||||
};
|
||||
<@endif>
|
||||
languages.go.enable = true;
|
||||
languages.typescript.enable = true;
|
||||
@@ -100,6 +117,12 @@
|
||||
on = "always";
|
||||
};
|
||||
};
|
||||
# Reuses the Metro bundler started by expodev.
|
||||
expoios = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
exec = "run-ios";
|
||||
cwd = "./apps/mobile";
|
||||
after = ["devenv:processes:expodev@started"];
|
||||
};
|
||||
<@endif>
|
||||
sqlwatcher = {
|
||||
exec = "sqlc generate";
|
||||
|
||||
Reference in New Issue
Block a user