うさがにっき

読書感想文とプログラムのこと書いてきます

さくらのCentOS上にAndroid実行環境を構築 その1<Android実行環境編>

ゴール

さくらのCentOS上のJenkinsでAndroidビルドを行う

順序

- Jenkinsインストール

前提条件

OS:CentOS release 6.5
Java:java version "1.6.0_30"
Jenkins:install済

実行手順

wget http://dl.google.com/android/android-sdk_r10-linux_x86.tgz
tar xvf android-sdk_r10-linux_x86.tgz
mv /opt ./android-sdk-linux_x86

  • adbが見当たらないので、確認すると以下のメッセージが

pwd
/opt/android-sdk-linux_x86/tools
ls
adb_has_moved.txt
cat

The adb tool has moved to platform-tools/
If you don't see this directory in your SDK,
launch the SDK and AVD Manager (execute the android tool)
and install "Android SDK Platform-tools"
Please also update your PATH environment variable to
include the platform-tools/ directory, so you can
execute adb from any location.

adbが移動したので、platform-toolsがない場合は一度アップデートしろとのこと

cd $ANDROID_HOME
ls
SDK Readme.txt add-ons platforms temp tools

無い、のでアップデート

cd platforms
./android update sdk -u

…ちょっち待機

ls
SDK Readme.txt add-ons platform-tools platforms temp tools

できた
適当なところにPATH定義

vi ~/.bashrc

#android定義
export ANDROID_HONE=/opt/android-sdk-linux_x86
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/platforms

コマンド通るか確認

adb
Android Debug Bridge version 1.0.29
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.


android実行環境完成
けどjenkinsへのandroid_homeの設定で警告メッセージが出る

SDK platforms directory appears to be empty. See inline help for info

次のjenkinsとandroidとの結びつけでちょっと調べる