The following guide can be applied on Mac OS X and Linux.
Prerequisites: git
and java
installed.
-
Download Android Studio beta. It includes: Android Studio (IDE based on Intellij IDEA), the Android SDK, Android tools and an Android emulator. Unzip this archive in a place you like, we're going to refer to the Android Studio directory later by AS_DIR. Note you don't have to use the Android Studio IDE. You can use your favorite editor and the command line build tool (
gradle
).$ export AS_DIR="/home/user/work/Android Studio"
-
Install the Android SDK version 20
$ echo yes | $AS_DIR/sdk/tools/android update sdk --filter android-20 --no-ui --force
-
Clone the WordPress for Android repository
$ git clone https://github.com/wordpress-mobile/WordPress-Android.git
-
Create the local.properties file:
$ cd WordPress-Android $ echo "sdk.dir = $AS_DIR/sdk/" > local.properties
-
Clone dependencies by invoking
gradle
(a build tool used by Android projects) from the root directory:$ ./gradlew cloneWordPressLibraries
-
Test compilation
$ ./gradlew build
-
Import the project in Android Studio. Start by launching Android Studio IDE then click
File -> Import Project
in the menu and select theWordPress-Android
directory. -
Plug your device or start an emulator (Genymotion is recommended). You can now install a debug version by clicking
Run -> Run 'WordPress-Android'
in the Android Studio menu or by invoking thisgradle
command:$ ./gradlew installVanillaDebug