17

Android Studio 0.2.2 をインストールしました。$PATH次のフォルダにある にSDK ツールを追加します。

/Applications/Android\ Studio.app/sdk/tools

たとえばPhonegapでそれらを使用できるようにします。

しかし、このフォルダーを に追加した後も、次の$PATHように言い続けます。

アンドロイド: コマンドが見つかりません

cd奇妙なことに、そのフォルダーに移動して名前を入力しても、そのフォルダー内の実行可能ファイルを実行できません。

私は何を間違っていますか?

4

5 に答える 5

10

このフォルダーを PATH に追加できます.bash_profile(ユーザーのホームフォルダーにある隠しファイル):

export PATH=/Applications/Android\ Studio.app/sdk/tools:$PATH

端末アプリケーションを再度開きます。

すべての UI アプリ用の環境が必要な場合は、.launchd.conf(または/etc/launchd.confすべてのユーザー用) を使用できます。

于 2013-08-09T09:30:22.853 に答える
6

これをあなたの中に入れてください~/.profile

# Add the Android SDK tools to $PATH and set $ANDROID_HOME (standard)
ANDROID_HOME="${HOME}/Library/Android/sdk"
if [ -d "${ANDROID_HOME}" ]; then
  PATH="${PATH}:${ANDROID_HOME}/tools"
  PATH="${PATH}:${ANDROID_HOME}/platform-tools"
  ANDROID_BUILD_TOOLS_DIR="${ANDROID_HOME}/build-tools"
  PATH="${PATH}:${ANDROID_BUILD_TOOLS_DIR}/$(ls -1 ${ANDROID_BUILD_TOOLS_DIR} | sort -rn | head -1)"
fi

ビルド ツールは、サブフォルダーにあるという点で他のツールとは異なります。たとえばbuild-tools/23.0.3, build-tools/25.0.1, build-tools/25.0.2... があるので、これは最新のものを選択します。

于 2017-01-04T00:57:31.757 に答える
2

You are getting bit by the escape character.

The reason tiziano's answer works for him is because the export command needs that backslash after "Android"

however, you are probably editing /etc/paths. When you put the path in there, you don't need the backslash, just put the lines:

/Applications/Android Studio.app/sdk/tools /Applications/Android Studio.app/sdk/platform-tools

in /etc/paths, and you are good to go.

于 2014-08-24T21:49:33.587 に答える
0

私にとってはそうでした

~/Development/adt-bundle-mac-x86_64-20130729/sdk
于 2015-06-17T16:33:43.157 に答える