Skip to content

New Installation Instructions

Stefan Simon edited this page Apr 13, 2014 · 11 revisions

Getting the Project files

Clone the files from our github page. If you don't know how to use git or github click here for an interactive tutorial.

Note about Gradle

We use a gradle based build system. Generally if you use an IDE like Android Studio or Eclipse you probabably won't notice this much. But there are a few points you should know:

  • All project configs like dependencies are done in the .gradle files and not directly in the IDE
  • The first time you try to compile the project, gradle will download dependencies from the internet. Depending on your connection this will take a few minutes.
  • Just pressing Play in your IDE will only call some gradle tasks (most likely just assembleDebug)
  • You can directly run gradle Tasks from console (see below) or depending on your IDE from a Gradle Tasks-Window

Android Studio Setup

You can find Android Studio here

  1. Launch Android Studio
  2. Click on Import Project
  3. Select the Catroid root source code folder (not catroid)
  4. Click OK
  5. Wait until the gradle setup has finished
    ImportProject
  6. Set Run - Edit Configurations... - Edit Defaults - Android Tests - Specific instrumentation runner to the value pl.polidea.instrumentation.PolideaInstrumentationTestRunner
  7. (Optional) activate View - Tool Buttons
  8. (Optional) Add Git root to enable VCS under Android Studio (Settings -> VCS -> Add Root)
    ImportProject

Running single tests in Android Studio

  1. Right-click on the test-class you want to run
  2. Choose Run->[YourTestClass]
    RunClass

There is a know issue with some version of Android Studio. A solution can be found at the bottom of this site.

Running source tests and static checks

Just run the appropriate gradle tasks from the Gradle Tool Window (View - Tool Windows - Gradle).
check will run all available static checks.
More information about running gradle tasks in Android Studio can be found here
Also see the Building from console section

Intellij Setup

TODO:

Eclipse Setup

TODO:

Building from console

Windows user: Substitute ./gradlew with gradlew.bat!
To build the catroid apk simple run ./gradlew assembleDebug
You can view all available gradle tasks by running ./gradlew tasks

Running tests from console

First you need to build catroid and the catroid tests by running: ./gradlew assembleDebug assembleDebugTest
Then simple run ./gradlew connectedAndroidTest
WARNING This will run all catroid tests which will take several hours!

Running source tests and static checks

  • SourceTests
    The sourcetests are in subproject an can be run by calling ./gradlew catroidSourceTest:test
  • Lint
    Run ./gradlew lint
  • Gradle tasks for Checkstyle, PMD and Findbugs will be available in the future

Known Issues

See below for some Common problems and solutions.
If you want to talk to someone on our team you can find us via IRC on freenet in #catrobat or #catrobatdev
Or if you don't have an IRC client simple use the web-irc from freenode: here

Android Studio Specific Issues

Wrong instrumentation runner when running a single test class

Unable to find instrumentation info for: ComponentInto{org.catrobat.catroid.test/android.test.InstrumentationTestRunner} If you get the above error follow these steps:

  1. Edit the Run Configuration of your test
    EditRunConfig
  2. Make sure the instrumentation runner is set to pl.polidea.instrumentation.PolideaInstrumentationTestRunner
    EditRunConfig
  3. Run again
    RunClass
  4. (Optional) Set Run - Edit Configurations... - Edit Defaults - Android Tests - Specific instrumentation runner to the value pl.polidea.instrumentation.PolideaInstrumentationTestRunner