a command-line utility that launches an iOS application on the iOS Simulator
#!/bin/bash
#
# author: square
#
# 命令行下运行模拟器,终端显示日志
# 日志默认保存在当前运行目录下
#
# ios-sim: https://github.com/phonegap/ios-sim
#
# tail -f ./error.log
# tail -f ./out.log
APP_PATH=$1
LOG_DIR=$2
function help
{
echo "Usage: $0 <APP文件路径> [日志路径]"
}
if [ -z "$APP_PATH" ]; then
help
exit 1
fi
if [ -z "$LOG_DIR" ]; then
LOG_DIR=$(pwd)
fi
ios-sim launch $APP_PATH --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-5s, 8.1" --stdout $LOG_DIR/out.log --stderr $LOG_DIR/error.log