How do you re-build the APK without re-building the syncthing library?

I’ve been using Android Studio to build the Synthing Android app, but it takes a long time to re-build everything when I click the “Debug syncthing-android” button, I think because it is re-building the syncthing library from scratch every time. How do I shortcut that and only re-build the APK so my debugging cycle goes more quickly?

The gradle build should be incremental, and use the already built syncthing binary. That is, as long as the binaries exist in the libs/ folder.

If you run gradle assembleDebug in the terminal, does it show the syncthing build output?

I was not paying attention and was just being impatient I guess. I installed gradle 1.10 manually to run the build without Android Studio to check your suggestion, but it’s taking the same amount of time and indeed is not re-building anything needlessly. It is also the same command that is being executed by Android Studio. I’m using a Linux Mint virtual machine in VirtualBox on a Macbook Air, and it takes about one minute to build the APK.

Note: I originally installed gradle using apt-get install gradle, but the version 1.4 was not high enough. Then I downloaded gradle 2.1 from the website and manually installed it, but that version is too high. Apparently gradle 1.10 is the Goldilocks version.

Yeah the stuff with Gradle versions is kind of annoying. I use 1.12 myself, so there seems to be a (small) range of versions that work.