Support BugVM Project


BugVM is an open source native App building tool. It compiles Java or Kotlin into native machine code and then links with other libraries or frameworks to produce native platform App.

In order to use native UI, bindings are necessary. Currently enough bindings are available for iOS Frameworks. Should the need arise, one can create do-it-yourself bindings to the frameworks or libraries that your App requires.

On macOS, one can build iOS App and macOS console application. The iOS App runs on the simulator, on the device, and can be packaged for the App Store submission.

On 64-bit Ubuntu, console application can be built. This is very useful for the server side scripts or command line tools. The performance gain should be significant.

Any Question or Feedback?

Email bug@bugvm.com

Sample iOS App

git clone https://github.com/bugvm/bugvm-ios
cd bugvm-ios
./gradlew sim

Using Gradle Plugin


buildscript {
ext {
    bugVMVersion = "1.2.3"
  repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
  dependencies {
    classpath "com.bugvm:bugvm-gradle:$bugVMVersion"

apply plugin: "java"
apply plugin: "bugvm"

repositories {
  maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

dependencies {
  compile "com.bugvm:bugvm-rt:$bugVMVersion"
  compile "com.bugvm:bugvm-apple:$bugVMVersion"

Gradle Tasks

BugVM plugin defines the following tasks:

launchIPhoneSimulator: Runs your iOS app in the iPhone simulator.
launchIPadSimulator: Runs your iOS app in the iPad simulator.
launchIOSDevice: Runs your iOS app on a connected iOS device.
launchConsole: Runs a console app.
createIPA: Creates .ipa file.

Launch to iPhone Simulator

./gradlew clean build launchIPhoneSimulator

Launch to iPad Simulator

./gradlew clean build launchIPadSimulator

Launch to Device

./gradlew clean build launchIOSDevice

Create IPA for App Store Submission

./gradlew clean build createIPA

Project Properties

The simulator launcher properties can be set by project properties via gradle.properties or -P command line parameter:

bugvm.device.name: Set the device name property. e.g iPhone-7, iPhone-6, iPhone-5s etc
bugvm.sdk.version: Set the sdk version property.

Simulator Device Names on Xcode 8.3

iPhone 5s (iPhone-5s)
iPhone 6 (iPhone-6)
iPhone 6 Plus (iPhone-6-Plus)
iPhone 6s (iPhone-6s)
iPhone 6s Plus (iPhone-6s-Plus)
iPhone 7 (iPhone-7)
iPhone 7 Plus (iPhone-7-Plus)
iPhone SE (iPhone-SE)
iPad Air 2 (iPad-Air-2)
iPad Pro (9.7-inch) (iPad-Pro--9-7-inch-)
iPad Pro (12.9-inch) (iPad-Pro)

To launch on the iPhone-7-Plus simulator:

./gradlew clean build -Pbugvm.device.name=iPhone-7-Plus launchIPhoneSimulator

To launch on the iPad Pro (12.9-inch) simulator:

./gradlew clean build -Pbugvm.device.name=iPad-Pro launchIPadSimulator

The createIPA task will by default include the archs listed in the bugvm.xml file in the archive. Use the bugvm.archs property to specify the archs to include in the archive:

./gradlew -Pbugvm.archs=thumbv7:arm64 createIPA

The bugvmInstall task is very similar to the createIPA task but doesn't archive the folder structure it creates.

To enable bitcode when running createIPA or bugvmInstall, add -Pbugvm.enableBitcode=true:.

./gradlew -Pbugvm.enableBitcode=true -Pbugvm.archs=thumbv7:arm64 createIPA

Building BugVM

You need a Mac running macOS 10.12. Download and install Java SE JDK 8 from Oracle. Make sure $JAVA_HOME is set properly by editing ~/.bash_profile

export JAVA_HOME=$(/usr/libexec/java_home)

Install Xcode 8 from the Mac App Store.

Use xcode-select command line tool to select correct Xcode if there are multiple versions of Xcode.

xcode-select -s /Applications/Xcode.app
xcode-select -s /Applications/OtherVersion/Xcode.app

Installing Xcode 8 Command Line Tools

xcode-select --install

You may need to install cmake, pkg-config, openssl if this is first time.

brew install pkg-config
brew install cmake
brew install openssl

Install any other missing components your build systems may complain about.

Clone GitHub repo.

git clone https://github.com/bugvm/bugvm
cd bugvm

The BugVM is built using Gradle Wrapper. If you are new to Gradle, take a look at https://docs.gradle.org/current/userguide/userguide.html. You don't need to install Gradle to use it, very nice.

./gradlew All

Note: It takes a few hours to complete the build process on MacBook Pro.

Building BugVM on Ubuntu 16.04 LTS

apt install git
apt install cmake
apt install g++
apt install libcap-dev
apt install zlib1g-dev
apt install openjdk-8-jdk
apt install g++-multilib
apt install gcc-multilib
apt install libxml2-dev

Install GNU Patch 2.7.3

wget http://ftp.gnu.org/gnu/patch/patch-2.7.3.tar.gz
tar xvf patch-2.7.3.tar.gz
cd patch-2.7.3
make install

Add JAVA_HOME environment

vi ~/.profile
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

Clone GitHub and Build

git clone https://github.com/bugvm/bugvm
cd bugvm
./gradlew All

Download Previous Stable SNAPSHOT

Followings work with Xcode 8 and iOS 10.

Compiler 1.1.19-SNAPSHOT
IDEA plugin 1.1.19-SNAPSHOT
BugVM Studio 1.1.10-SNAPSHOT

, -.