mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-30 23:34:12 +03:00
21 lines
562 B
Nix
21 lines
562 B
Nix
{stdenv, xcodewrapper}:
|
|
{name, appName ? null, app, device ? "iPhone", baseDir ? ""}:
|
|
|
|
let
|
|
_appName = if appName == null then name else appName;
|
|
in
|
|
stdenv.mkDerivation {
|
|
name = stdenv.lib.replaceChars [" "] [""] name;
|
|
buildCommand = ''
|
|
ensureDir $out/bin
|
|
cat > $out/bin/run-test-simulator << "EOF"
|
|
#! ${stdenv.shell} -e
|
|
|
|
cd "${app}/${baseDir}/${_appName}.app"
|
|
"$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${_appName}' -SimulateDevice '${device}'
|
|
EOF
|
|
chmod +x $out/bin/run-test-simulator
|
|
'';
|
|
}
|
|
|