Search Unity

Error on Automated Build when multiple instances of Unity are open

Discussion in 'Scripting' started by elissa-tong, Sep 21, 2014.

  1. elissa-tong

    elissa-tong

    Joined:
    Jun 25, 2013
    Posts:
    9
    Hi,

    I have a build script that I want to run in the command line.

    C:\Users\me>unity.exe -quit -batchmode -nographics -executeMethod CommandB
    uild.BuildUniversalApps -projectPath C:\Users\me\Documents\Development\Uni
    ty\Projects\2DPlatformer


    This works fine when I have the Unity project window closed. But if I have Unity open with the project loaded, I can't make a build anymore.

    C:\Users\me>unity.exe -quit -batchmode -nographics -executeMethod CommandB
    uild.BuildUniversalApps -projectPath C:\Users\me\Documents\Development\Uni
    ty\Projects\2DPlatformer


    C:\Users\me>
    Aborting batchmode due to failure:
    Fatal error! It looks like another Unity instance is running with this project o
    pen.
    Multiple Unity instances cannot open the same project.
    Project: C:/Users/me/Documents/Development/Unity/Projects/2DPlatformer


    How do I fix this issue?
    Thank you for your help

    Why I want it: I have a Unity project exported to a Windows Phone platform. My workflow is as follows: make scene and asset changes in Unity. Then go to Visual Studio (with the Unity C# project & Windows Phone project opened in the same Visual Studio Solution file), make code & script changes. Then play to test in Emulator... the new build picks up the script changes but doesn't pick up the Asset changes that I made in Unity. I want to add the Unity build commands to Visual Studio's Pre-Build events.