Search Unity

Build & Run custom Editor (install on device)

Discussion in 'iOS and tvOS' started by liszto, Jul 28, 2014.

  1. liszto

    liszto

    Joined:
    Dec 22, 2011
    Posts:
    135
    Hi !
    I've got a simple question for Unity developers.

    How is realized your "Build a Run" button. Cause we have a custom editor with a custom pipeline to created our XCode project file and build.
    We search for a long time how to install and run the apps on our device but we find only custom 3rd party libs and co. So I would know if it's possible how did you realize this @ Unity ?

    Thanks in advance for your help.
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Unity includes an Xcode plugin, see:

    /Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Tools/OSX/Unity4XC.xcplugin

    This gets loaded by Xcode because it's symlinked from ~/Application Support/Developer/Shared/Xcode/Plug-ins/Unity4XC.xcplugin. The plugin has a simple socket connection which allows Unity to talk to it (on /tmp/unityxplugin). Not sure if it's possible for you to talk over that directly - the protocol is simple, but not documented. (I guess the problem will be that Unity has the socket open, and doesn't want to share it.)
     
  3. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  4. liszto

    liszto

    Joined:
    Dec 22, 2011
    Posts:
    135
    oh I totally forget this -destination option :eek: !!

    I see in the documentation there is a generic parameter. It works if I plug a device or I always must specify the device name ?
    Cause when we build with your "Build & run" it runs on the device for any iOS device. There is a trick for this or "/generic" will work if a device is plugged or takes the simulator if nothing is plugged ?

    I try so many things with destination option set and this never push something on my connected device :(. There is something special to do ?

    There is something special to do ? I mean I try "build" / "test" / "install" but nothing push the version on my device :(
     
    Last edited: Jul 29, 2014
  5. liszto

    liszto

    Joined:
    Dec 22, 2011
    Posts:
    135
    I use the command line gave by Manta in the other thread and finally all works fine.

    Some external plugin create some exception in the Target test i remove them and it works.

    I've got and extra question always based on what you do in "Build & Run". How can you push on a device without knowing his id or name. Cause -destination must know at least an id or a name for the current device which is plug on our MAC.

    How can you dodge this problem ? I try with "generic/platform=iOS" but this work only for simulator target and not for a "generic" device plugged.

    So simple question : How can you detect the current device plugged for XCode ? Cause I found no solution at this time.
     
  6. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Build and run uses an Xcode plugin, so all Unity has to do is tell the plugin to run the game. Xcode picks up that request and knows what device is connected. The plugin basically just pokes the Xcode menu.
     
  7. liszto

    liszto

    Joined:
    Dec 22, 2011
    Posts:
    135
    Ok thanks for the answer !

    I will investigate to do the same. Thanks again.