3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/mobile/xcodeenv/simulate-app.nix
2013-05-29 14:50:24 +02:00

18 lines
469 B
Nix

{stdenv, xcodewrapper}:
{name, app, device ? "iPhone", baseDir ? ""}:
stdenv.mkDerivation {
name = stdenv.lib.replaceChars [" "] [""] name;
buildCommand = ''
ensureDir $out/bin
cat > $out/bin/run-test-simulator << "EOF"
#! ${stdenv.shell} -e
cd "${app}/${baseDir}/*.app"
"$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${name}' -SimulateDevice '${device}'
EOF
chmod +x $out/bin/run-test-simulator
'';
}