0

Following on from my question How to run an xcode project from bash?

I've found the built *.app in the build directory, but I'm trying to figure out how to get xcode to open it as it can't just be run as a Mac OS X program.

Any ideas?

thanks to chuan at this post: XCode Test Automation For IPhone

2
  • Are you talking about Simulator or Device? Commented Jan 6, 2011 at 9:23
  • Device, I've figured it out using AppleScript Commented Jan 6, 2011 at 10:02

2 Answers 2

2

I'm stuck with the same problem trying to launch my debug output from building my xcode project. I just experimented with the following

open ./prog.app&

seems to do the trick.

Sign up to request clarification or add additional context in comments.

Comments

0

I've solved my problem using a bash file that uses rsync to sync working directories and then AppleScript which builds and runs the project.

sync.sh:

#!/bin/bash

# script for moving development files into xcode for building
developmentDirectory="/"
xcodeDirectory="/"
echo 'Synchronising...'
rsync -r $developmentDirectory $xcodeDirectory \
--exclude='.DS_Store' --exclude='.*' --exclude='utils/' --exclude='photos'
echo 'Synchronising Done at:'
echo $(date)

buildandrun:

set projectName to "projectName"
# AppleScript uses : for / in directory paths
set projectDir to "Users:username:Documents:" & projectName & ":" & projectName & ".xcodeproj"
tell application "Xcode"
    open projectDir
    tell project projectName
           clean
           build
           (* for some reasons, debug will hang even the debug process has completed. 
              The try block is created to suppress the AppleEvent timeout error 
            *)
           try
               debug
           end try
    end tell
    quit
end tell

Then, finally, I'm using a shell script called run.sh aliased in my .bash_profile:

run.sh:

#!/bin/bash

bash utils/sync.sh
osascript utils/buildandrun

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.