cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [05/11] ios commit: [CB-2998] Add a ./cordova/lib/start-emulator project-level helper script to iOS
Date Thu, 25 Apr 2013 13:42:58 GMT
[CB-2998] Add a ./cordova/lib/start-emulator project-level helper script to iOS


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

Branch: refs/heads/master
Commit: 075b1391ad1b53f4ffde49c602db4af5f975e283
Parents: 7f4f694
Author: Shazron Abdullah <shazron@apache.org>
Authored: Thu Apr 25 05:16:17 2013 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Thu Apr 25 06:36:37 2013 -0700

----------------------------------------------------------------------
 bin/templates/project/cordova/lib/sim.applescript |   10 ++++
 bin/templates/project/cordova/lib/start-emulator  |   35 ++++++++++++++++
 2 files changed, 45 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/075b1391/bin/templates/project/cordova/lib/sim.applescript
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/sim.applescript b/bin/templates/project/cordova/lib/sim.applescript
new file mode 100755
index 0000000..2297f7e
--- /dev/null
+++ b/bin/templates/project/cordova/lib/sim.applescript
@@ -0,0 +1,10 @@
+tell application "iPhone Simulator"
+    activate
+end tell
+
+tell application "System Events"
+    tell process "iPhone Simulator"
+    click menu item "$DEVICE_NAME" of menu 1 of menu item "Device" of menu 1 of menu bar
item "Hardware" of menu bar 1
+    click menu item "Home" of menu 1 of menu bar item "Hardware" of menu bar 1
+    end tell
+end tell

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/075b1391/bin/templates/project/cordova/lib/start-emulator
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/start-emulator b/bin/templates/project/cordova/lib/start-emulator
new file mode 100755
index 0000000..d7f6cb3
--- /dev/null
+++ b/bin/templates/project/cordova/lib/start-emulator
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash 
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# 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
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# Valid values for "--target" (case insensitive):
+#     "iPhone (Retina 3.5-inch)" (default)
+#     "iPhone (Retina 4-inch)"
+#     "iPhone"
+#     "iPad"
+#     "iPad (Retina)"
+
+set -e
+
+
+DEFAULT_TARGET="iPhone (Retina 3.5-inch)"
+TARGET=${1:-$DEFAULT_TARGET}
+LIB_PATH=$( cd "$( dirname "$0" )" && pwd -P)
+
+SCPT=`sed -e "s/\\$DEVICE_NAME/$TARGET/g" $LIB_PATH/sim.applescript`
+osascript -e "$SCPT"


Mime
View raw message