Skip to content

Commit

Permalink
Allow providing bundle identifier to run-in-ios-sim
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Aug 13, 2020
1 parent 2bb9943 commit 1318010
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ios/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ nixpkgs.runCommand "${executableName}-app" (rec {
cp -LR "$(dirname $0)/../${executableName}.app" $tmpdir
chmod -R +w "$tmpdir/${executableName}.app"
mkdir -p "$tmpdir/${executableName}.app/config"
${../scripts/run-in-ios-sim} "$tmpdir/${executableName}.app"
${../scripts/run-in-ios-sim} "$tmpdir/${executableName}.app" "${bundleIdentifier}"
'';
portableDeployScript = nixpkgs.writeText "make-portable-deploy" ''
#!/usr/bin/env bash
Expand Down
7 changes: 6 additions & 1 deletion scripts/run-in-ios-sim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ set -euo pipefail
name="${1##*/}"
name="${name%.app}"

bundleIdentifier="$name"
if [ "$#" = 2 ]; then
bundleIdentifier="$2"
fi

runtime="$(xcrun simctl list runtimes -j | jq -r '.runtimes[].identifier' | head -n1)"
uuid="$(xcrun simctl create "$name" com.apple.CoreSimulator.SimDeviceType.iPhone-8 "$runtime")"

Expand All @@ -26,4 +31,4 @@ echo Installing "$name".app >&2
xcrun simctl install "$uuid" "$1"

echo Launching "$name" >&2
xcrun simctl launch --console "$uuid" "$name"
xcrun simctl launch --console "$uuid" "$bundleIdentifier"

0 comments on commit 1318010

Please sign in to comment.