I would like to have my iphone test app to be tested automatically in an IPhone. The following are the steps I would like to have:
The comment section does not provide a good way of display the solution properly. Here is the summary of answer.
The task of building IPhone app, uploading and trigger the debug process on IPhone is done via AppleScript. Here is how the AppleScript looks like:
tell application "Xcode"
open "Users:chuan:Desktop:iphone_manual_client:iphone_manual_client.xcodeproj"
tell project "iphone_manual_client"
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
AppleScript accepts ":" instead of "/" for file and folder separator.
The GDB console output can be captured by setting the GDB option to write it to file. this is done by typing the following command in Terminal:
defaults write com.apple.Xcode PBXGDBDebuggerLogToFile YES
defaults write com.apple.Xcode PBXGDBDebuggerLogFileName <path to my gdb output file>
Lastly, many thanks to various ppl who have helped to solve this problem.
xcodebuild will just build the binary and it will not upload the newly compiled binary to iphone.
actually it can upload (after signing it), but not run too bad... maybe it can be run using gdb once connected to target but how (ip?, usb? usbnet?) ?
There's a command line tool "xcodebuild" you can call to kick off an XCode build without it being open. There are flags you can use to set targets and so on.
Could you add a build phase to the target that runs a script to upload the binary to the iphone?
Right click the target, Add->New Build Phase->New Run Script Build Phase
Dr Nic's testing with Ruby may help with some of this
Check out iphone_testify, it works well with OCUnit and Google Toolbox For Mac, and I think it could be possible extend it for something like UISpec.
Regards