blob: f2ed598736b67ac254f8321e3c936711f2cd6e86 [file] [log] [blame]
philippeeeb07332012-07-04 21:59:29 +00001
2How to install and run an android emulator.
3
4mkdir android # or any other place you prefer
5cd android
6
7# download java JDK
8# http://www.oracle.com/technetwork/java/javase/downloads/index.html
9# download android SDK
10# http://developer.android.com/sdk/index.html
11# download android NDK
12# http://developer.android.com/sdk/ndk/index.html
13
14# versions I used:
15# jdk-7u4-linux-i586.tar.gz
16# android-ndk-r8-linux-x86.tar.bz2
17# android-sdk_r18-linux.tgz
18
19# install jdk
20tar xzf jdk-7u4-linux-i586.tar.gz
21
22# install sdk
23tar xzf android-sdk_r18-linux.tgz
24
25# install ndk
26tar xjf android-ndk-r8-linux-x86.tar.bz2
27
28
29# setup PATH to use the installed software:
30export SDKROOT=$HOME/android/android-sdk-linux
31export PATH=$PATH:$SDKROOT/tools:$SDKROOT/platform-tools
32export NDKROOT=$HOME/android/android-ndk-r8
33
34# install android platforms you want by starting:
35android
36# (from $SDKROOT/tools)
37
38# select the platforms you need
39# I selected and installed:
40# Android 4.0.3 (API 15)
41# Upgraded then to the newer version available:
42# Android sdk 20
43# Android platform tools 12
44
philippeeeb07332012-07-04 21:59:29 +000045# then define a virtual device:
46Tools -> Manage AVDs...
47# I define an AVD Name with 64 Mb SD Card, (4.0.3, api 15)
48# rest is default
49
50
51# compile and make install Valgrind, following README.android
52
53
54# Start your android emulator (it takes some time).
55# You can use adb shell to get a shell on the device
56# and see it is working. Note that I usually get
57# one or two time out from adb shell before it works
58adb shell
59
60# Once the emulator is ready, push your Valgrind to the emulator:
61adb push Inst /
62
63
sewardj4450a0e2014-09-03 15:19:25 +000064# IMPORTANT: when running Valgrind, you may need give it the flag
65#
66# --kernel-variant=android-emulator-no-hw-tls
67#
68# since otherwise it may crash at startup.
69# See README.android for details.
70
71
philippeeeb07332012-07-04 21:59:29 +000072# if you need to debug:
73# You have on the android side a gdbserver
74# on the device side:
75gdbserver :1234 your_exe
76
77# on the host side:
78adb forward tcp:1234 tcp:1234
79$HOME/android/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gdb your_exe
80target remote :1234
81