ANDROID_HOME not set (VSTS agent running as service on OS X)

后端 未结 1 686
半阙折子戏
半阙折子戏 2020-12-18 08:08

I have configured the VSTS agent on my MacBook Pro and it works perfectly when I manually run it (using ./run.sh).

However when I configure the VSTS age

相关标签:
1条回答
  • 2020-12-18 08:22

    In your agent folder, there is a file named runsvc.sh. Add your export in there. You'll see a commented-out line prompting you where to put your env setup:

    # insert anything to setup env when running as a service
    export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk
    

    Make sure to restart the service.

    The reason .bash_profile doesn't work for you is because the service doesn't have access to that when it runs.

    I had the same problem and found the solution here: https://github.com/Microsoft/vsts-tasks/issues/1726#issuecomment-219725321

    For those developing with Xamarin, you'll typically need this instead:

    # insert anything to setup env when running as a service
    export ANDROID_HOME=/Users/$(whoami)/Library/Developer/Xamarin/android-sdk-macosx
    
    0 讨论(0)
提交回复
热议问题