は私が読んでその情報に基づいて、OSXは、端末とlaunchdの間に別の環境変数の設定を使用します。
〜/ Library/LaunchAgents /の中にlaunchd plistファイルを作成しました。あなたは.plist拡張子を持つランダムなファイル名を選ぶことができます。私の場合は、androidstudio.plistという名前を付けました。
以下
ファイル(androidstudio.plist)の内容です:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>launchctl setenv ANDROID_AVD_HOME /Volumes/Data/Android/.android/avd; launchctl setenv ANDROID_SDK_HOME /Volumes/Data/Android</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>