CLI yaklaşımı
Ubuntu 15.10, Android 22'de test edilmiştir.
Bir cihaz:
Sonra:
sudo apt-get install ant gradle openjdk-7-jdk
cd
# Get device permissions.
# MANUAL find vendor ID on this table: http://developer.android.com/tools/device.html#VendorIds
# http://stackoverflow.com/a/5510745/895245
VENDOR_ID='054c'
UDEV_PATH='/etc/udev/rules.d/51-android.rules'
echo 'SUBSYSTEM=="usb", ATTR'"$VENDOR_ID"'=="0bb4", MODE="0666", GROUP="plugdev"' | sudo tee "$UDEV_PATH"
sudo chmod a+r "$UDEV_PATH"
sudo /etc/init.d/udev restart
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
tar -xvf android-sdk_r24.4.1-linux.tgz
# MANUAL run the ./tools/android GUI and install the SDK versions you need
# Better: just download EVERYTHING to save you annoyances later on.
# Yes, it takes a ton of space (50Gib+).
# http://stackoverflow.com/questions/17963508/how-to-install-android-sdk-build-tools-on-the-command-line
# The automated command line should look something like:
#API=22
#N="$(android list sdk --all |& grep 'SDK Platform Android' | grep "API $API" | cut -d- -f1)"
#android update sdk -u -a -t $N
# Studio
wget https://dl.google.com/dl/android/studio/ide-zips/1.5.1.0/android-studio-ide-141.2456560-linux.zip
unzip android-studio-ide-141.2456560-linux.zip
cd android-studio/bin
./studio.sh
# NDK
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
chmod a+x android-ndk-r10e-linux-x86_64.bin
./android-ndk-r10e-linux-x86_64.bin
mv android-ndk-r10e android-ndk
~/.profile
Şuna ekle : TODO: bunlardan hangisi gerçekten gerekli?
export ANDROID_SDK="$HOME/android-sdk"
# Present on the default build.xml generated by "android create project [...] in Android 22.
export ANDROID_HOME="$ANDROID_SDK"
export ANDROID_NDK="$HOME/android-ndk"s
export ANDROID_NDK_ROOT="$ANDROID_NDK"
# Used by https://github.com/googlesamples/android-ndk/tree/3cd41e1f5280443665ca98463c7a76e80bf0b96c/native-codec
export ANDROID_NDK_HOME="$ANDROID_NDK"
export ANDROID_ABI='armeabi-v7a'
export ANDROID_JAVA_HOME="$JAVA_HOME"
export ANDROID_STUDIO="$HOME/android-studio/"
export PATH="$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools:${ANDROID_STUDIO}/bin:${ANDROID_NDK}:${PATH}"
Çıkış yap ve giriş yap. İhtiyacın olabilir:
sudo "$(which adb)" kill-server
sudo "$(which adb)" start-server
Kurulumu test edin
Ellerini bunun gibi minimal bir projeye sok ya da altına bak $ANDROID_SDK/samples/
.
Eğer bir Karınca projesi ise (bir build.xml
dosya içeriyorsa ) çalıştırın:
ant debug
ant installd
Gradle projesiyse (bir gradlew
dosya içeriyorsa ) çalıştırın:
./gradlew assembleDebug
./gradlew installDebug
Uygulamanın cihazınıza yüklü olması gerekir.
Studio (ADT halefi) ile başlatılabilir:
studio.sh
NDK örnekleri altında bulunabilir $ANDROID_NDK/samples
ve bunları oluşturabilir ve yükleyebilirsiniz:
ndk-build
# Create build.xml, as per: http://stackoverflow.com/questions/5572304/how-to-build-the-android-sample-projectsusing-ant-build-xml-does-not-exist
android update project -p . -t android-22
ant clean
ant debug
ant installd
Resmi Debian paketlerinin durumu
Şu anda resmi bir Debian paketi yok.
Ancak bunu çözmeye çalışan bir Google Yaz Kodu 2015 projesi var: https://www.google-melange.com/gsoc/project/details/google/gsoc2015/seamlik/5707702298738688