Search code examples
iphonexcodexcodebuild

xcodebuild install path?


I am developing an iphone app using xcode. I would like to automate the "build and run" process, and so want to know if there is any way to install the built app on simulator or device.

There is xcodebuild install command but i don't know how to set the installation directory DSTROOT to simulator/device. Please help me there.

I have looked through many forums where people suggest just to use xcode GUI to do the stuff, and I do that too, but I would really like to know the command-line way.

Thanks


Solution

  • All you need to do is copy the built .app from wherever XCode puts it to ~/Library/Application Support/iPhone Simulator/User/Applications/[somefolder]/, with a file named [somefolder].sb (alongside the folder, not in it) containing the following:

    (version 1)
    (debug deny)
    (allow default)
    

    Then launch /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator. And select your App. Without Jailbreaking it's NOT possible to install it from outside the GUI.