I’m setting up an Automator script for our iPhone project which we would like to have build our Unity project, and then install the resulting App to the device automatically. The reason for this is that we would like to run the script overnight so that when we come in the next day, anyone can pick up the device and see the progress on the application.
So far, I’ve been able to get Unity to build the project automatically through the command line tools and an associated editor script, like so:
Command Line
open -a Unity --args -executeMethod AutomatedBuild.PerformIOSBuild -quit
I then looked into building and running the XCode project. It is possible to build the project using the “xcodebuild” command (or the associated Automator command), but I couldn’t find a way to INSTALL the app to the device with xcode on the command line. (if anyone knows how to do this, I would love to hear)
So, with xcodebuild failing to install to the device for me, I realized that Unity seems to do the whole “create xcode project > compile through xcode > run on device” process automatically, so I was wondering if there is something else I can include in my PerformIOSBuild() method to make this happen, or if there is some other piece to this puzzle that I am missing.
Hi,
we are using AppleScript to launch Unity iOS app on device using Xcode. If I remember correctly “install” step isn’t available as separate action, just as part of “debug” action.
If I recall right, the buildoptions flag BuildOptions.AutoRunPlayer is what “build run” in the editor does (while showbuilt player would be the normal “just build”) which should do it all for you.
Also, unless my mind is overworked, you are trashing the build flag there by using instead of | or +, aren’t you?
Haha, I think you are right about the build flags. I had tried the AutoRunPlayer build option, but considering that I can’t keep my and | separated, I’ll give it another shot to see if that works.
Also, thanks for the Applescript lead. I was hoping I could do it all with Automator, but I guess I should learn Applescript anyway.
Hey, just wanted to check back in over here. I’m making some good progress and will likely write a tutorial on this, but I’ve got one more roadblock to overcome or run into.
I’ve got a shell script all set up to make the build directory, run Unity via the command line, build in xcode, and copy to the device, and this script works fine if I just run it via the terminal.
I’ve set it up to be a daily periodic script that is run by the system. My problem now is that when the computer wakes up in the morning, it runs the scripts in the background when the login screen is up. This is the behavior I’m hoping for because if I’ve got to log in to run the scripts, I might as well just do the process manually. Of course, an issue might be that Unity can only be run when you are logged in. Can anyone confirm/deny that this is the case?
Don’t know if this is helpful, but I receive a crash file for the automated build in the console. Here is a snippet of it:
Did you ever end up writing the tutorial? Also, I’m trying to perform a simliar deployment process.
shell script that does an xcode build
deploy internal build file to device using iTunes or iPhone Configuration Utility
I’d like to avoid using XCode when deploying the app to the device to better emulate what my QA team performs. They currently receive an internal app build file and then use iTunes to install the app to the device.
Are you using iTunes to deploy the app to a device? If so, do you know if there’s a way to automate that process, perhaps via AppleScript?