Guest User

Untitled

a guest
Jul 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Build and iPhone Simulator Helper Script
  4. # Shazron Abdullah 2011
  5. #
  6. # WARN: - if your .xcodeproj name is not the same as your .app name,
  7. # this won't work without modifications
  8. # - you must run this script in where your .xcodeproj file is
  9.  
  10. PROJECTNAME=$1
  11. CONFIGURATION=$2
  12. LOGFILE=$3
  13.  
  14. function help
  15. {
  16. echo "Usage: $0 <projectname> [configuration] [logname]"
  17. echo "<projectname> name of your .xcodeproj file (and your .app as well)"
  18. echo "[configuration] (optional) Debug or Release, defaults to Debug"
  19. echo "[logname] (optional) the log file to write to. defaults to stderror.log"
  20. }
  21.  
  22. # check first argument
  23. if [ -z "$PROJECTNAME" ] ; then
  24. help
  25. exit 1
  26. fi
  27.  
  28. # check second argument, default to "Debug"
  29. if [ -z "$CONFIGURATION" ] ; then
  30. CONFIGURATION=Debug
  31. fi
  32.  
  33. # check third argument, default to "stderror.log"
  34. if [ -z "$LOGFILE" ] ; then
  35. LOGFILE=stderr.log
  36. fi
  37.  
  38. # backup existing logfile (start fresh each time)
  39. if [ -f $LOGFILE ]; then
  40. mv $LOGFILE $LOGFILE.bak
  41. fi
  42.  
  43. touch -cm www
  44. xcodebuild -configuration $CONFIGURATION -sdk iphonesimulator -project $PROJECTNAME.xcodeproj
  45. ios-sim launch build/$CONFIGURATION-iphonesimulator/$PROJECTNAME.app --stderr $LOGFILE --exit
  46. osascript -e "tell application \"iPhone Simulator\" to activate"
  47. tail -f $LOGFILE
Add Comment
Please, Sign In to add comment