Giter Club home page Giter Club logo

hanga-cli's Introduction

Hanga Command Line Interface

Hanga is a build automation tool for Python applications targeting mobile devices. Hanga-CLI is a client for Hanga.

Hanga is a build service in the cloud, specialized to build Python applications, as long as your application is managed with Buildozer. Hanga currently works only for Android - iOS support will come soon - and will also manage signing with your keystore. It is easy to install and setup. You can be ready in a few minutes!

Hanga is currently in closed Beta.

Installing Hanga

  1. Install hanga: pip install hanga
  2. Open an account
  3. Grab your API key
  4. Save your API key into hanga: hanga set apikey YOUR_API_KEY

Usage

You need to have a project managed with Buildozer.

Create the specification file with Buildozer, and adjust it
buildozer init
Submit your application to Hanga
hanga android debug

A typical output will look like:

$ hanga android debug
# Check configuration tokens
# Ensure build layout
# Prepare the source code to pack
# Compress the application
# Submit the application to build
# Submitting Flat Jewels
Upload [############################################################################################] 536.66 kB/s

Build submitted, uuid is 3c49499a-c762-11e3-bbbc-04011676f501
You can check the build status at:

    https://hanga.io/app/com.meltingrocks.flatjewels

Or you can wait the build to finish.
It will automatically download the package when done.

Done [####################################################################################] Elapsed Time: 0:02:22
# Downloading the build result
Downloading [#######################################################################################]   4.47 MB/s
# FlatJewels-0.4.1-debug.apk available in the bin directory
# Done !

The build result goes directly into a bin/ directory in your project.

Importing keys

By default, any application build with Hanga will be compiled with the default Hanga.io development key. If you want to get unsigned build, go to your application page, and select "Don't sign the application".

Or you can import your key to Hanga.io from https://hanga.io/settings, or using the command line:

$ hanga importkey ~/code/keys/myapp.keystore
Importing <myapp.keystore> to Hanga.io

Keystore password:
Key/alias name: my_alias
Key password (let empty to use the keystore password):
Give a name to Hanga for identify this key: Android key

Thanks you, we are adding your key...
... Done!

hanga-cli's People

Contributors

tito avatar brousch avatar

Stargazers

Angus H. avatar Marios Papachristou avatar

Watchers

 avatar James Cloos avatar

Forkers

brousch

hanga-cli's Issues

Cannot run android build

trying to run
hanga android

I'm missing something?

Compress the application

Create custom buildozer.spec

Submit the application to build

Submitting Kivy Designer Tabs

Traceback (most recent call last):
File "/usr/bin/hanga", line 11, in
sys.exit(main())
File "/usr/lib/python2.7/site-packages/hanga/scripts/client.py", line 368, in main
HangaClient().run_command(arguments)
File "/usr/lib/python2.7/site-packages/hanga/scripts/client.py", line 85, in run_command
self._run_android_build(arguments)
File "/usr/lib/python2.7/site-packages/hanga/scripts/client.py", line 106, in _run_android_build
self.cloud_submit(args, filename)
File "/usr/lib/python2.7/site-packages/hanga/scripts/client.py", line 179, in cloud_submit
result = self._hangaapi.submit(args, filename, submit_callback)
File "/usr/lib/python2.7/site-packages/hanga/api.py", line 68, in submit
requests.post, "submit", data=fd, params=params, stream=True)
File "/usr/lib/python2.7/site-packages/hanga/api.py", line 182, in _build_request
r = method(url, headers=headers, *_kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 109, in post
return request('post', url, data=data, json=json, *_kwargs)
File "/usr/lib/python2.7/site-packages/requests/api.py", line 50, in request
response = session.request(method=method, url=url, *_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, *_send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)

'Worker' object has no attribute 'apk_fn' problem

Hello! You are doing an outstanding work out there! However, I am having the following issue:
When I am trying to build an app, I get the following error:
'Worker' object has no attribute 'apk_fn'
What might be happening?
Thanks in advance
screenshot from 2014-09-09 10 45 36

Incorrect API Code Causes Crash

I ran Hanga with an intentionally incorrect API code. Instead of a nice error message I got:

C:\Users\ben\Projects\saythis>hanga -v android debug
I Check configuration tokens
I Ensure build layout
Unable to read the state.db, content will be replaced.
D Create directory C:\Users\ben\.buildozer\hanga\platform\hanga\platform
D Create directory .buildozer\hanga\platform
D Create directory .buildozer\hanga\app
I Prepare the source code to pack
D Copy application source from C:\Users\ben\Projects\saythis\saythis
D Create directory C:\Users\ben\Projects\saythis\.buildozer\hanga\app
D Copy C:\Users\ben\Projects\saythis\saythis\main.py
D Copy C:\Users\ben\Projects\saythis\saythis\saythis.kv
D Create directory C:\Users\ben\Projects\saythis\.buildozer\hanga\app\images
D Copy C:\Users\ben\Projects\saythis\saythis\images\background.png
D Create directory C:\Users\ben\Projects\saythis\.buildozer\hanga\app\resources
D Copy C:\Users\ben\Projects\saythis\saythis\resources\highres-icon.png
D Copy C:\Users\ben\Projects\saythis\saythis\resources\icon-114x114.png
D Copy C:\Users\ben\Projects\saythis\saythis\resources\icon.png
D Copy C:\Users\ben\Projects\saythis\saythis\resources\presplash.jpg
D Create directory C:\Users\ben\Projects\saythis\.buildozer\hanga\app\resources\
pinstriped_suit
D Copy C:\Users\ben\Projects\saythis\saythis\resources\pinstriped_suit\pinstripe
d_suit.png
D Copy C:\Users\ben\Projects\saythis\saythis\resources\pinstriped_suit\pinstripe
[email protected]
I Compress the application
D Create custom buildozer.spec
I Submit the application to build
I Submitting Say This
Upload [##########################################################]   6.59 kB/s
Traceback (most recent call last):
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\runpy.py", line 162, in _run_modu
le_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\Scripts\hanga.exe\__main__.py", line
9, in <module>
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\site-packages\hanga\scripts\clien
t.py", line 257, in main
    HangaClient().run_command(arguments)
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\site-packages\hanga\scripts\clien
t.py", line 95, in run_command
    self.cloud_submit(args, filename)
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\site-packages\hanga\scripts\clien
t.py", line 168, in cloud_submit
    result = self._hangaapi.submit(args, filename, submit_callback)
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\site-packages\hanga\api.py", line
 55, in submit
    return r.json()
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\site-packages\requests-2.2.1-py2.
7.egg\requests\models.py", line 741, in json
    return json.loads(self.text, **kwargs)
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\json\__init__.py", line 338, in l
oads
    return _default_decoder.decode(s)
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\json\decoder.py", line 365, in de
code
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Kivy-1.8.0-py2.7-win32\Python27\lib\json\decoder.py", line 383, in ra
w_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.