mirror of https://github.com/BOINC/boinc.git
3.9 KiB
3.9 KiB
Goals
Provide a turn-key VM for Android development
Requirements
On Linux, MacOS or Windows with VirtualBox
- Vagrant
- VirtualBox
- VirtualBox Extension Pack for USB 3.0 support.
- Host:
- 4 CPU cores (2 used by VM)
- ~18 GB disk space
- 4 GB RAM (2 used by VM)
- Download volume (once): ~3.5 GB
On Windows with Hyper-V
- Hyper-V
- Host:
- 4 CPU cores (2 used by VM)
- ~18 GB disk space
- 8 GB RAM (4 used by VM)
- Download volume (once): ~3.5 GB
HOWTO
- On your host: open a terminal
- Clone the BOINC repo and
cd <BOINC_REPO>/android
or just download the Vagrantfile from GitHub vagrant up
- Wait until the final reboot finished
- From this point on you don't need Vagrant anymore
- Don't run
vagrant up
again! - Just use VirtualBox/Hyper-V to stop/start your new shiny VM
- Don't run
- Clone the BOINC repo and
- In the VM:
- Log in with
vagrant/vagrant
- Open a terminal
cd ~/BOINC/android
./build_client.sh
- Start Android Studio
- No need to change anything in the setup assistant (just complete it)
- OK / Next / Next / Finish / Finish
- Import the BOINC App as Gradle project from:
~/BOINC/android/BOINC
- Ignore potential Gradle Plugin warning: Don't remind me again
- Log in with
- Hook up your Android device via USB (and remember to attach it to VirtualBox)
- Happy hacking :-)
Android Virtual Device Manager
Hyper-V can run Android Virtual Device Manager, but you have to install KVM and add vagrant user to KVM Group.
- Open a terminal
apt install qemu-kvm
adduser vagrant kvm
- Reboot the VM.
Known limitations
- The Android Virtual Device Manager might not work properly as it needs virtualization which isn't possible within a virtual machine (at least not using VirtualBox). Although Hyper-V can run Android Virtual Device Manager.
- On Windows it seems the VirtualBox manage GPU acceleration a little better on Ubuntu 18.04, than Hyper-V, despite the fact that Windows added Enhanced Session Mode to Ubuntu 18.04.
Push to GitHub without password using ssh-key
If you want to do a push
without username and password prompt, you have to do the following:
- Open terminal.
- Go to the BOINC repository:
cd ~/BOINC
- Switch the remote URL from HTTPS to SSH:
git remote set-url origin git@github.com:BOINC/boinc.git
- Verify that the remote URL has changed:
git remote -v
- Generate a new SSH key:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
- When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
- When you're prompted to "Enter passphrase (empty for no passphrase)" type a secure passphrase.
- Add your SSH key to the ssh-agent.
- Start the ssh-agent in the background:
eval "$(ssh-agent -s)"
- Add your SSH private key to the ssh-agent:
ssh-add ~/.ssh/id_rsa
- Start the ssh-agent in the background:
- Add the new SSH key to your GitHub account
- Copy the SSH key to your clipboard:
cat ~/.ssh/id_rsa.pub
- In the upper-right corner of GitHub, click your profile photo, then click Settings.
- In the user settings sidebar, click SSH and GPG keys.
- Click New SSH key.
- In the Title field, add a descriptive label for the new key. For example "BOINC Android Development".
- Paste your key into the Key field.
- Copy the SSH key to your clipboard:
For more information check out the Connecting to GitHub with SSH article.