Sha256: 88fed5002a3deca376de2810763d589a8ab4d674569584afabe09ba3c4d1dbb7

Contents?: true

Size: 1.7 KB

Versions: 4

Compression:

Stored size: 1.7 KB

Contents

#! /bin/sh
#
# 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.
#

set -e

CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd )
PROJECT_PATH=$CORDOVA_PATH/..

function getAppPath() {
	for file in $PROJECT_PATH/*.xcodeproj; do
	  PROJECT_NAME=$(basename "$file" .xcodeproj)
	done;
	APP=build/$PROJECT_NAME.app
	APP_PATH=$PROJECT_PATH/$APP
}

APP_PATH=$1

if [ $# -lt 1 ]; then
	getAppPath
fi

if [ ! -d "$APP_PATH" ]; then
	read -p "Project '$APP_PATH' is not built. Build? [y/n]: " REPLY 
	if [ "$REPLY" == "y" ]; then 
		$CORDOVA_PATH/debug
		exit 0
	else 
		echo "$APP_PATH not found to emulate."
		exit 1
	fi	
fi

# launch using ios-sim

if which ios-sim >/dev/null; then
    ios-sim launch $APP_PATH --stderr console.log --stdout 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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mobox-0.0.3 vendor/phonegap/lib/ios/bin/templates/project/cordova/emulate
mobox-0.0.2 vendor/phonegap/lib/ios/bin/templates/project/cordova/emulate
mobox-0.0.1.1 vendor/phonegap/lib/ios/bin/templates/project/cordova/emulate
mobox-0.0.1 vendor/phonegap/lib/ios/bin/templates/project/cordova/emulate