ShadowKat Studios

Remotely building Cyanogenmod 13

Part 1 of why you should never try to do any form of Android development ever.

I’m away from home at the moment, with only my laptop (A Lenovo IdeaPad S10e). I’ve been wanting to upgrade my phone from Cyanogenmod 12 for a while, however the only nightlies availible from the cyanogenmod site are Cyanogenmod 14, which seems a little more buggy than I’d like. This seemed like a perfect time to figure out how to build Cyanogenmod, so I can learn how to enable the features I need to run LXC on Android as well.

So, obviously, the first plan was to build it on my laptop. That wasn’t going to work.

My laptop

Right, so that won’t work. Fortunately, at home I have a nice, powerful server I can spin up a VM on. The CM wiki recommends using Ubuntu but I prefer Debian, so I throw up a Debian VM with two cores (of a Xeon 1231v3), 8GB of RAM and 200GB of disk space.

I follow the guides on the wiki on setting up a build environment and such, and it takes a few hours to download the 20GB of source files. Plenty of time for a dip in the pool and such.

I run into somewhat of a problem at the “Extract proprietary blobs” section. The scripts assume adb on the machine you’re building on can talk to your device. To recap, the machine I’m building CM on is 300km or so away and my phone is sitting on the table next to me. What does our hero do now?

Okay, thing 1: in the Developer Options section of Settings on my phone, I can enable ‘ADB over network’. This lets me connect to ADB over the network, as you may have guessed. It uses TCP. Okay, great, now I no longer need the cable to copy files to/from my phone. Thing 2: ssh can do remote port forwarding, so I can forward a port my laptop can access to a port on a remote machine. This means that I can forward the port adb over network uses to my virtual machine 300km away.

[izaya@sks-s10e-1 ~]$ ssh -R *:5555: cmbuild

So this is where I’m at now: waiting for my files to upload from my phone over 3G. I’ll update this soon.

By Izaya

Tags: tech software bad-software hardware android

© ShadowKat Studios
The software used to generate this page is licensed under the Mozilla Public License version 2 and can be found here