Mac에서 Android SDK 찾기 및 PATH 추가
MacBook Air (OS 버전 10.11 El Capitan)에 Android Studio를 설치했으며 작은 "hello, world"앱을 작성하고 장치 (Nexus 7)에 설치하고 AVD에서 실행했습니다. 내가하고 싶은 일은 Android Studio와 달리 명령 줄에서 앱을 빌드하고 장치에 설치할 수 있다는 것입니다. 나는 여기의 지시를 따르고 있습니다 :
http://developer.android.com/training/basics/firstapp/running-app.html
관련 줄은 다음과 같습니다.
Android SDK platform-tools / 디렉토리가 PATH 환경 변수에 포함되어 있는지 확인한 후 다음을 실행하십시오.
문제는 내 컴퓨터에서 Android SDK를 찾을 수 없다는 것입니다! 그렇지 않으면 프로그램이 Android Studio를 통해 컴파일되고 실행되지 않기 때문에 거기에 있다고 가정합니까? 아마도 그것은 나쁜 가정입니까? Mac에 익숙하지 않아 (Windows에 익숙 함) Android SDK를 검색하는 가장 좋은 방법을 모릅니다. 그래서 내 질문 :
- 컴퓨터에서 Android SDK를 어떻게 찾습니까? 아니면 거기에 없다고 스스로에게 증명합니까?
- 없는 경우 어떻게 설치합니까?
- Android SDK를 포함하도록 PATH를 어떻게 변경합니까?
1. 찾는 방법
Android 스튜디오를 열고 Goto Android Studio> 환경 설정 SDK를 검색하십시오. 이와 비슷한 것이 표시됩니다 (이것은 볼 수있는 창 상자입니다)
대부분의 경우 위치를 볼 수 있습니다. /Users/<name>/Library/Android/sdk
2. 설치 방법 (없는 경우)
Just go-to Android Standalone sdk download page , download the zip file for OSX and extract it to a directory
3. How to add it to the path
Open your terminal application and open paths file in nano by typing
sudo nano /etc/paths
Input your password,Go to the end of the lines and input the directory path. And you want to add: eg:-
/Users/username/Libs/android-sdk-mac_x86/platform-tools
Save it by pressing Ctrl+X, Restart the terminal application and To see if it is working or not - type in the name of any file or binary which are inside the directories that you've added and verify it is opened/executed
If you don't want to open Android Studio just to modify your path...
They live here with a default installation:
${HOME}/Library/Android/sdk/tools
${HOME}/Library/Android/sdk/platform-tools
Here's what you want to add to your .bashwhatever
export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
- How do I find Android SDK on my machine? Or prove to myself it's not there?
When you install Android studio, it allows you to choose if you want to download SDK or not
- If it's not there how do I install it?
you can get SDK from here http://developer.android.com/sdk/index.html
- How do I change PATH to include Android SDK?
in Android Studio click in File >> Settings
Find the Android SDK location
Android Studio
> Preferences
> Appearance & Behaviour
> System Settings
> Android SDK
> Android SDK Location
Create a .bash_profile
file for your environment variables
- Open the Terminal app
- Go to your home directory via
cd ~
- Create the file with
touch .bash_profile
Add the PATH variable to your .bash_profile
- Open the file via
open .bash_profile
Add
export PATH=$PATH:
[your SDK location]
/platform-tools
to the file and hit⌘s
to save it. By default it's:export PATH=$PATH:/Users/yourUserName/Library/Android/sdk/platform-tools
Go back to your Terminal App and load the variable with
source ~/.bash_profile
If Android Studio shows you the path /Users/<name>/Library/Android/sdk
but you can not find it in your folder, just right-click and select "Show View Option". There you will be able to select "Show Library Folder"; select it and you can access the SDK.
The default path of Android SDK is /Users/<username>/Library/Android/sdk
, you can refer to this post.
add this to your .bash_profile to add the environment variable
export PATH="/Users/<username>/Library/Android/sdk/tools:/Users/<username>/Library/Android/sdk/build-tools:${PATH}"
Then save the file.
load it
source ./.bash_profile
AndroidStudioFrontScreen 하드 드라이브에 저장 한 Android dmg 설치 파일을 두 번 클릭하기 만하면 초기 화면이 나타나면 Android Studio 아이콘을 Applications 폴더로 끌어서 놓았습니다. 또한 실행할 때 Dock에서 Android Studio를 마우스 오른쪽 버튼으로 클릭하고 "옵션"-> "Keep on Dock"을 선택하십시오. 다른 모든 것이 작동합니다. 로저 웹스터 박사
참고 URL : https://stackoverflow.com/questions/34532063/finding-android-sdk-on-mac-and-adding-to-path
'development' 카테고리의 다른 글
EditText 깜박임 커서 비활성화 (0) | 2020.05.27 |
---|---|
C #의 콘솔 앱에서 비동기? (0) | 2020.05.27 |
XCTest의 기본 모듈을로드 할 수 없습니다 (0) | 2020.05.27 |
레일에서 네임 스페이스 내에 컨트롤러를 생성하는 방법 (0) | 2020.05.27 |
Bash 스크립트를 사용하여 중복 항목 제거 (0) | 2020.05.27 |