2013-01-07 15:52:42 +00:00
|
|
|
{stdenv, xcodewrapper}:
|
2013-08-05 10:47:57 +00:00
|
|
|
{ name, appName ? null, app
|
|
|
|
, device ? "iPhone", baseDir ? ""
|
2014-01-15 20:52:43 +00:00
|
|
|
, sdkVersion ? "7.0"
|
2013-08-05 10:47:57 +00:00
|
|
|
}:
|
2013-01-07 15:52:42 +00:00
|
|
|
|
2013-05-29 13:01:55 +00:00
|
|
|
let
|
|
|
|
_appName = if appName == null then name else appName;
|
|
|
|
in
|
2013-01-07 15:52:42 +00:00
|
|
|
stdenv.mkDerivation {
|
2013-02-12 10:35:21 +00:00
|
|
|
name = stdenv.lib.replaceChars [" "] [""] name;
|
2013-01-07 15:52:42 +00:00
|
|
|
buildCommand = ''
|
|
|
|
ensureDir $out/bin
|
|
|
|
cat > $out/bin/run-test-simulator << "EOF"
|
|
|
|
#! ${stdenv.shell} -e
|
|
|
|
|
2013-05-29 13:01:55 +00:00
|
|
|
cd "${app}/${baseDir}/${_appName}.app"
|
2013-08-16 11:20:59 +00:00
|
|
|
"$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${_appName}' -SimulateDevice '${device}' -currentSDKRoot "$(readlink "${xcodewrapper}/SDKs")/iPhoneSimulator${sdkVersion}.sdk"
|
2013-01-07 15:52:42 +00:00
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/run-test-simulator
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
|