Build Instructions (Linux & OS X)
December 13, 2016 · View on GitHub
The instructions below will help you build Silk for the supported devices on Linux and OS X.
Prerequisites
- For Linux users: see Prerequisites (Linux)
- For OS X users: see Prerequisites (OS X)
We also provide a Docker image.
Building and using the emulator
git clone https://github.com/silklabs/silk.git
cd silk/bsp-gonk/
./sync qemu
source build/envsetup.sh
make -j4
./run-emulator
In a new terminal:
adb wait-for-device
adb logcat
Building for Nexus 4 (mako)
Cloning
Cloning should be always the same:
git clone https://github.com/silklabs/silk.git
cd silk/bsp-gonk/
Unlocking the bootloader
then, building and flashing for mako is going to need your device's bootloader to be unlocked, if it is you can skip this part. But if you don't know what's unlocking a bootloader, chances are you need to follow these steps as well.
1- Power off your LG / Google Nexus 4 device. Boot it into Fastboot mode by pressing at the same time the Volume down and Power buttons. When the screen shows the “start” text, release the buttons.
2- Connect your device to your computer via USB.
3- Run fastboot oem unlock from your terminal.
That should unlock your Nexus 4 device.
Building from source
Now for the actual building process:
./sync mako
source build/envsetup.sh
make -j4
Flashing to devices
You're going to want to to switch again to Fastboot, but if it's still on it from the unlocking process then you can skip this. Otherwise run:
adb reboot-bootloader
and then make sure fastboot can recognize your device correctly by running
fastboot devices
Your output should be similar to this
0079aa645d500341 fastboot
Where 0079aa645d500341 will be different for different devices.
fastboot flash all
Which will flash the Silk device img files onto it. And lastly reboot to Silk by running:
fastboot reboot
After the devices has successfully rebooted. Try running these commands to ensure that it's up and running.
adb wait-for-device
adb logcat
Re-flashing
Flashing another img requires to boot into bootloader again whether by following step 1 in Unlocking the bootloader section or running
adb reboot-bootloader
and then another
fastboot flash all
Flashing a stock Android rom again
If you want to switch back to normal Android, here are the instructions for flashing Android 5.1.1 to your device:
First download the stock Nexus 4 5.1.1 (LMY47V) ROM from https://dl.google.com/dl/android/aosp/occam-lmy47v-factory-b0c4eb3d.tgz then
occam-lmy47v-factory-b0c4eb3d.tgz
cd occam-lmy47v
./flash.sh
For detailed instructions on Flashing a stock rom, head out to the official Google Developers page.
Happy hacking!