cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject [2/50] ios commit: Add option for ipad/iphone in cordova/emulate
Date Mon, 25 Feb 2013 13:41:02 GMT
Add option for ipad/iphone in cordova/emulate

Based off of pull request from net-uk-sweet (thanks!)


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/fb49c5d5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/fb49c5d5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/fb49c5d5

Branch: refs/heads/multipart_plugin_result
Commit: fb49c5d58580f6812c0dbdd6d14331c49c7a1b90
Parents: 7f29bed
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Feb 12 10:10:22 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Feb 12 10:11:06 2013 -0500

----------------------------------------------------------------------
 bin/templates/project/cordova/emulate |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fb49c5d5/bin/templates/project/cordova/emulate
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/emulate b/bin/templates/project/cordova/emulate
index ef7198e..f26cb3a 100755
--- a/bin/templates/project/cordova/emulate
+++ b/bin/templates/project/cordova/emulate
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -7,9 +7,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 # http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -33,11 +33,8 @@ PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
 XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
 PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
 
-APP_PATH=$1
-
-if [ $# -lt 1 ]; then
-	APP_PATH="$PROJECT_PATH/build/$PROJECT_NAME.app"
-fi
+APP_PATH=${1:-$PROJECT_PATH/build/$PROJECT_NAME.app}
+DEVICE_FAMILY=${2:-${DEVICE_FAMILY:-iphone}}
 
 if [ ! -d "$APP_PATH" ]; then
 	echo "Project '$APP_PATH' is not built. Building."
@@ -51,7 +48,7 @@ fi
 
 # launch using ios-sim
 if which ios-sim >/dev/null; then
-    ios-sim launch "$APP_PATH" --stderr "$CORDOVA_PATH/console.log" --stdout "$CORDOVA_PATH/console.log"
&
+    ios-sim launch "$APP_PATH" --family "$DEVICE_FAMILY" --stderr "$CORDOVA_PATH/console.log"
--stdout "$CORDOVA_PATH/console.log" &
 else
     echo -e '\033[31mError: ios-sim was not found. Please download, build and install version
1.4 or greater from https://github.com/phonegap/ios-sim into your path. Or "brew install ios-sim"
using homebrew: http://mxcl.github.com/homebrew/\033[m'; exit 1;
 fi


Mime
View raw message