14
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android の Linux 環境をターミナルから構築する

Last updated at Posted at 2015-02-16

Android SDK のダウンロード

wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
tar zxvf android-sdk_r24.0.2-linux.tgz
sudo mv android-sdk-linux/ /opt/
rm android-sdk_r24.0.2-linux.tgz

Android SDK の ANDROID_HOME と PATH 設定

export ANDROID_HOME=/opt/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

printenv コマンドで設定ができたかどうかの確認ができます.

Android SDK のアップデート

android update sdk --no-ui

android list sdk --all で確認
yes コマンドを使うといろいろ捗るかもしれない

Android NDK のダウンロード

環境を確認

uname -m

x86_64 の場合は Linux 64-bit (x86) をダウンロードする

wget http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin
chmod a+x android-ndk-r10d-linux-x86_64.bin
./android-ndk-r10d-linux-x86_64.bin
sudo mv android-ndk-r10d /opt/
rm android-ndk-r10d-linux-x86_64.bin

Android NDK の ANDROID_NDK_HOME と PATH 設定

export ANDROID_NDK_HOME=/opt/android-ndk-r10d
export PATH=${PATH}:$ANDROID_NDK_HOME

printenv コマンドで設定ができたかどうかの確認します.

おまけ

ndk_download.sh

if [ `uname -m` = x86_64 ]; then 
  wget http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin -O ndk.bin; 
else 
  wget http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86.bin -O ndk.bin; 
fi
sudo apt-get install -y p7zip-full
7z x ndk.bin > /dev/null

local_properties.sh

cd Project
touch local.properties
echo "sdk.dir=$ANDROID_HOME" >> local.properties
echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties
14
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?