A2O, a converter from iOS app to web app, is now open source

Tasuku SUENAGA
Tombo Blog
Published in
2 min readJun 25, 2018

We released Tombo Platform on Feb 14, 2017. Tombo Platform was a website which has web applications converted from iOS applications by A2O.

A2O is our technology to convert iOS applications into web applications.

We decided to make A2O open source and close Tombo Platform.

Because:
1. We pivoted.
2. A2O is based on many open source products. It’s our turn now!

Now you can convert your iOS application into a web application and release it.

The repositories are under the organization “tombo-a2o”.

You can see a sample of a converted app on http://demo.tombo.io/.

How to build your project

We’ll show you how to build your project. The sample project is Cocos2DSamples by @shephertz.

Under the project Cocos2DSamples, there are three samples, Fight Ninja, Soccer_Demo and Words Junkie. A2O can build two of them, Fight Ninja and Words Junkie.

At first, you have to install a2obrew. This is a build tool for A2O. You can find how to install it in README.md.

After a2obrew installation, you can build games of Cocos2DSamples.

git clone git@github.com:shephertz/Cocos2DSamples# Build Fight Ninja
cd Fight\ Ninja
# Put a2o_project_config.rb which has details about a build
editor a2o_project_config.rb
# add a2o tools into $PATH
eval "$(a2obrew init -)"
# build with a2obrew
a2obrew xcodebuild -t release # build
# run with Chrome
emrun --browser chrome \
a2o/build/release/products/application/application.html
# run with Firefox
emrun --kill_start --browser firefox --profile=emscripten_user \
a2o/build/release/products/application/application.html
# Build Words Junkie
cd ../Words\ Junkie
(the same lines...)

The file a2o_project_config.rb has information about how to build.

This is the sample code of a2o_project_config.rb for Fight Ninja.Changingxcodeproj_path to Words Junkie.xcodeprojand xcodeproj_target into Words Junkie works for Words Junkie.

cc_flags = '-s FULL_ES2=1 -DGL_GLEXT_PROTOTYPES=1 -DCC_TEXTURE_ATLAS_USE_VAO=0'
html_flags = '-s FULL_ES2=1 -s TOTAL_MEMORY=134217728'
# html_flags += ' -s GL_TRACE=1 -s GL_ASSERTIONS=1'
release_runtime_parameters = {
}
debug_runtime_parameters = {
emscripten: {
http_logging: true
},
shell: {
auto_launch: true
}
}
config = {
version: 1,
xcodeproj_path: 'Fight Ninja.xcodeproj',
xcodeproj_target: 'Fight Ninja',
a2o_targets: {
debug: {
xcodeproj_build_config: 'Debug',
flags: {
cc: "-O1 -DDEBUG=1 -DCD_DEBUG=1 -DCOCOS2D_DEBUG=1 #{cc_flags}",
html: "-O0 -s OBJC_DEBUG=1 #{html_flags} --emrun -g2"
},
runtime_parameters: debug_runtime_parameters
},
release: {
xcodeproj_build_config: 'Release',
flags: {
cc: "-Oz #{cc_flags}",
# NOTE: -s AGGRESSIVE_VARIABLE_ELIMINATION=1 doesn't work
html: "-O2 #{html_flags}"
},
runtime_parameters: release_runtime_parameters
},
}
}
config

The a2o_project_config.rb is written in Ruby. This a2o_project_config.rb can be used as a template.

You can find more detailed instruction on https://github.com/tombo-a2o/a2obrew/blob/master/README.md .

If you try to build your project, you will probably face some problems. It would be great if you could make a pull request about that :)

--

--

Tasuku SUENAGA
Tombo Blog

a.k.a. gunyarakun, a software engineer and a cat manager