10

Is there way to build iphone app on the command line with xcodebuild, then automatically deploy the app to a USB-connected iphone device and run some unit testing on device?

Right now, I can do this under xCode with "Build and Run", but I'm looking for solution to do this outside of the xCode GUI environment.

Thanks

gcamp
  • 14,622
  • 4
  • 54
  • 85
bob
  • 1,941
  • 6
  • 26
  • 36
  • The automatic building of iPhone applications has been addressed in these questions: [Command line compiling an iPhone Application](http://stackoverflow.com/questions/1358939/command-line-compiling-an-iphone-application), [Continuous Integration for Xcode projects?](http://stackoverflow.com/questions/212999/continuous-integration-for-xcode-projects), and [Best practice for setting up an automated build server for iphone apps?](http://stackoverflow.com/questions/3837043/best-practice-for-setting-up-an-automated-build-server-for-iphone-apps). However, I don't see much about installation there. – Brad Larson Oct 25 '10 at 22:04
  • 1
    Thanks for the links. Yes, these will take care of automated build, but I'm looking for solution that would push the build to a USB-connected iPhone and execute some test code. I can do this manually through the "Build and Run" button under xCode, but I also want to automate the push-to-iphone-and-test step. Right now, it looks like comment on Applescript is the way to go. – bob Oct 26 '10 at 01:44
  • @bob did you ever find out a way to get this working? 10 years later and this is still one of the only posts that has the exact thing I'm looking for – Rohan Shah May 30 '21 at 01:30

1 Answers1

3

You can script Xcode using Applescript, and run Applescript scripts from the command line.

There more on how to script Xcode in this answer.

Community
  • 1
  • 1
hotpaw2
  • 70,107
  • 14
  • 90
  • 153