macosx packaging failed: Unknown command/target osx

64 views
Skip to first unread message

Glen Rubin

unread,
Feb 12, 2023, 11:18:28 AM2/12/23
to Kivy users support
I just finished packaging my android app and am now trying to make one for macos.

As per the packaging page, I ran the command:

pip install git+http://github.com/kivy/buildozer cd /to/where/I/Want/to/package buildozer init

which did not work and stated that my directory was not installable...so instead ran pip install git+http://github.com/kivy/buildozer

which installed terminal buildozer-1.5.1.dev0 init-0.1.0 terminal-0.4.0

I then ran buildozer init which created a new spec file.  I edited the spec and then tried:

buildozer osx debug

but get the error in my subject line:  Unknown command/target osx

Robert

unread,
Feb 12, 2023, 11:55:14 AM2/12/23
to Kivy users support
Buildozer packages for mobile devices, not desktops.

I expect (but have no experience) you want pyinstaller for osx.

Glen Rubin

unread,
Feb 12, 2023, 12:00:34 PM2/12/23
to kivy-...@googlegroups.com
ah ok, very good i will look at pyinstaller.  

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/VHfYismOqPw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/a51deeba-866a-4182-ba89-e0932199b514n%40googlegroups.com.

Glen Rubin

unread,
Feb 12, 2023, 12:50:05 PM2/12/23
to kivy-...@googlegroups.com
On this page it seems to indicate that you can use buildozer.  They seem to recommend using kivy-sdk for mac os packaging overy pyinstaller and that buildozer uses the sdk, https://kivy.org/doc/stable/guide/packaging-osx.html

Am I missing something?

Elliot Garbus

unread,
Feb 12, 2023, 1:38:10 PM2/12/23
to kivy-...@googlegroups.com

I routinely use pyinstaller to build Windows and Mac executables:

 

Below is a sample spec file.  I put the spec file in a directory under the main project.  Set the app_nam, and mac_icon as appropriate.  Also set the datas section as required for your code.

 

After building the app, for open source projects I simply zip the file for distribution.  For professional projects I build a dmg using DropDMG.

https://c-command.com/dropdmg/

 

For Windows projects I build a Windows installer using inno Setup.  https://jrsoftware.org/isinfo.php

 

 

 

# -*- mode: python -*-

block_cipher = None
app_name = 'Your App Name'
mac_icon = '../Images/your_app_icon.icns'


a = Analysis(['../main.py'],
             pathex=[],
             binaries=[],
             datas=[('../*.kv', '.'),
                    ('../Images/*.png', './Images')],  # edit to match your program
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=['_tkinter', 'Tkinter', 'enchant', 'twisted'],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)

pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)

exe = EXE(pyz,
          a.scripts,
          [],
          exclude_binaries=True,
          name=app_name,
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=False,
          console=False)

coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=False,
               name=app_name)

app = BUNDLE(coll,
             name=app_name + '.app',
             icon=mac_icon,
             bundle_identifier=None)

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CABw5z-ASztqvM5TRw3O7w0qQygPX-Qa3zHxehVQUc5o6XSR5oQ%40mail.gmail.com.

 

Glen Rubin

unread,
Feb 12, 2023, 2:13:12 PM2/12/23
to kivy-...@googlegroups.com
I am hoping to sell the app I am making and don't really know much about MacOS.  My wife has a Mac, so I am planning on borrowing hers and then working as fast as possible to get what I need done lol.  Are you saying that you use PyInstaller first to produce some kind of runnable mac app, which then needs to be converted into an DMG by DropDMG?  Sorry for all the basic questions here...I know so little about mac and just want to get something that users can download.  I will use your spec as a guide...thanks!

Glen Rubin

unread,
Feb 12, 2023, 2:16:22 PM2/12/23
to kivy-...@googlegroups.com
i should clarify from that last message...I will sell it on a business website and not on any kind of app store.  i'm not a huge fan of the FAANGs!

Elliot Garbus

unread,
Feb 12, 2023, 2:37:44 PM2/12/23
to kivy-...@googlegroups.com

On the mac the .app “file” is actually a special directory.  You can distribute it by compressing it into a zip file.  This is the easiest, you can just right click in finder, and select compress – and you will get a zip file ready for distribution.  I have done this with a number of open source apps, I provide simple directions and have had no issues from users.

 

You can also distribute the app as a DMG, this is a compressed archive where the users is requested to drag an icon to complete the install.  You can add a little art work.  I’ve done this for a number of programs and again – no issues from mac users.  It does provide a more polished look. 

 

There are also more sophisticated installers.  It is really a function of what your users expect and the experience you want to create.

 

Here is the look of the DMG installer for firefox:

enter image description here

Robert

unread,
Feb 12, 2023, 3:09:27 PM2/12/23
to Kivy users support
> Am I missing something?

That documentation is I think just wrong, deeply totally absolutely incorrect, no basis of truth anywhere.

Glen Rubin

unread,
Feb 12, 2023, 3:14:34 PM2/12/23
to kivy-...@googlegroups.com
Thanks so much Robert!  I wonder why they posted that documentation if its not true. Very misleading!

Robert

unread,
Feb 12, 2023, 3:46:03 PM2/12/23
to Kivy users support
The good news is, this shows there is somebody out there who reads documentation.🤣

Robert

unread,
Feb 13, 2023, 3:19:16 PM2/13/23
to Kivy users support
It does work, but only on a Mac - which would be the case for pyinstaller too.

That said given the comment in that link, I'd say stick with pyinstaller.

Mirko Galimberti

unread,
Feb 13, 2023, 3:30:26 PM2/13/23
to Kivy users support
Hi everyone!

Just to clarify:
As our docs (https://kivy.org/doc/stable/guide/packaging-osx.html?highlight=packaging) are suggesting, `kivy-sdk-packager` is meant for that, and the pre-packaged `Kivy.app` could be used, if you would not build everything from scratch.

Additionally, from our docs:
> buildozer right now uses the Kivy SDK to package your app. If you want to control more details about your app than buildozer currently offers then you can use the SDK directly, as detailed in the section below.

So, yes, buildozer supports packaging for osx (only on macOS), but needs some love as doesn't support all the options that kivy-sdk-packager offers.

Anyway, pyinstaller is also an option, but we will likely drop the support soon, as we will need to package a self-build version of the SDL deps.

Glen Rubin

unread,
Feb 13, 2023, 4:04:41 PM2/13/23
to kivy-...@googlegroups.com
that explains my error, since i was trying to compile from linux

Reply all
Reply to author
Forward
0 new messages