Skip to content

Instantly share code, notes, and snippets.

@maxme
Last active August 29, 2015 14:04
Show Gist options
  • Save maxme/d01fe74d13a681865dbe to your computer and use it in GitHub Desktop.
Save maxme/d01fe74d13a681865dbe to your computer and use it in GitHub Desktop.

The following guide can be applied on Mac OS X and Linux.

Prerequisites: git and java installed.

  1. 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"
    
  2. Install the Android SDK version 20

     $ echo yes | $AS_DIR/sdk/tools/android update sdk --filter android-20 --no-ui --force
    
  3. Clone the WordPress for Android repository

     $ git clone https://github.com/wordpress-mobile/WordPress-Android.git
    
  4. Create the local.properties file:

     $ cd WordPress-Android
     $ echo "sdk.dir = $AS_DIR/sdk/" > local.properties
    
  5. Clone dependencies by invoking gradle (a build tool used by Android projects) from the root directory:

     $ ./gradlew cloneWordPressLibraries
    
  6. Test compilation

     $ ./gradlew build
    
  7. Import the project in Android Studio. Start by launching Android Studio IDE then click File -> Import Project in the menu and select the WordPress-Android directory.

  8. 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 this gradle command:

     $ ./gradlew installVanillaDebug
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment