briefcase icon indicating copy to clipboard operation
briefcase copied to clipboard

Add support for Apple watchOS

Open freakboy3742 opened this issue 9 years ago • 37 comments
trafficstars

Now that the Python iOS support libraries support watchOS, Briefcase should also support that platform.

This will involve:

  • Producing a cookiecutter template project (analogous to Python-iOS-template)
  • Adding a new command to Briefcase to support tvOS. The implementation of this command will be almost identical to iOS, with names and images changed.

freakboy3742 avatar Dec 21 '15 09:12 freakboy3742

I would like to work on this issue

souravsingh avatar Jan 12 '16 17:01 souravsingh

Awesome! Thanks for offering to help out!

The first step - fire up XCode, and create a new, blank Apple Watch project. Historically, I've called that project "Aaaa Bbbb", with an executable name of XXXXXXXX, from company YYYYYYYY.ZZZZZZZZ - having strings like that in the project make it much easier to build a template later.

You should be able to copy the bootstrap main.m from the iOS/tvOS template, and invoke a simple "hello world" Python script. It won't do anything other than print to the console, but that's enough to get a template going.

freakboy3742 avatar Jan 13 '16 00:01 freakboy3742

@freakboy3742 This is fixed now, correct?

souravsingh avatar Apr 09 '17 21:04 souravsingh

Not really - there are stubs there for most of the pieces, but I haven't seen a "hello world" app running on an Apple Watch (or simulator).

freakboy3742 avatar Apr 10 '17 06:04 freakboy3742

Is this being managed? or may I help? please

Ry10p avatar Jul 05 '17 02:07 Ry10p

@Ry10p - sure - especially if you've got access to a physical Apple Watch. I don't, so I haven't been able to test any builds.

So - if you want to look into this, the first step is to build - completely independent of Briefcase - an XCode project that includes and uses Python that will run on an Apple Watch. It doesn't have to do anything - just print "Hello world" - but that will establish what we need to template for the benefit of Briefcase.

freakboy3742 avatar Jul 06 '17 00:07 freakboy3742

@freakboy3742 Sir,

I unfortunately do not have access to an apple watch.

I am more than willing to emulate the "watch os".

If this is OK I would love to help out, if you would rather a REAL apple watch I will work on another issue :).

Ry10p avatar Jul 06 '17 00:07 Ry10p

Oh, sure - you can use the emulator if you want. I figured that it wouldn't be as interesting as a problem unless you actually had a watch to use the end product. If you want to fiddle around with the emulator, that's fine, too.

freakboy3742 avatar Jul 06 '17 00:07 freakboy3742

LOVE IT

Ill start right away!

Thank you! -Ryan Carl

Ry10p avatar Jul 06 '17 00:07 Ry10p

@freakboy3742

Update on the Project: Steps I have taken so far...

  1. fire up XCode, and create a new, blank Apple Watch project

  2. I've called that project "Aaaa Bbbb", with an executable name of XXXXXXXX, from company YYYYYYYY.ZZZZZZZZ.

  3. Forked the Python-iOS-template to create a copy of the bootstrap main.m.

Are the next steps to download the frameworks and create a "Hello world" app using the frameworks that have found at this location https://github.com/pybee/Python-iOS-template/tree/3.5?

Ry10p avatar Jul 07 '17 09:07 Ry10p

@Ry10p Correct - A Hello World app is the next step.

freakboy3742 avatar Jul 10 '17 03:07 freakboy3742

@Ry10p Have you made any progress on this? I'd be interested in working with you to move this issue forward. (I have a physical Apple Watch that i can use to test things out.)

meichthys avatar Aug 16 '18 18:08 meichthys

@meichthys

You can for sure take this one, I am attempting to emulate the watchOS but my computer has been not allowing the emulation of the macOS system. I have been attempting to fix this with VirtualBox.

Fire up XCode, and create a new, blank Apple Watch project

Call that project "Aaaa Bbbb", with an executable name of XXXXXXXX, from company YYYYYYYY.ZZZZZZZZ.

If you have any problems please feel free to ask and I will attempt to help out, I have completed the build on:Android, Linux, my friends macOS, and Windows... So I can help out a little.

Ry10p avatar Aug 16 '18 20:08 Ry10p

@meichthys

issuexcode

Ry10p avatar Aug 16 '18 22:08 Ry10p

@Ry10p Ok. I'll see what I can do and will be in touch if (when) i run into some roadblocks.

meichthys avatar Aug 16 '18 23:08 meichthys

@Ry10p I'm able to build a iOS app with a watchOS target, but i'm not sure where to add the python code. What are we trying to accomplish here?

meichthys avatar Aug 19 '18 19:08 meichthys

I can build a HelloWorld app in Xcode without much problem, but that doesn't seem to help much if we're not using python for the app...

meichthys avatar Aug 19 '18 19:08 meichthys

@meichthys

Could you possibly detail your process?

Are you building for tvOS with Beeware Breifcase, then importing the resulting build into Xcode to run?

Ry10p avatar Aug 19 '18 20:08 Ry10p

@Ry10p

I've tried it multiple ways:

  1. Using Briefcase (i don't think this is what we want to do at this point as per @freakboy3742) a. Use Briefcase tutorial (https://briefcase.readthedocs.io/en/latest/tutorial/tutorial-1.html) b. Package using python setup.py ios -s c. Open resulting project in Xcode i. Add a WatchOS target (File -> New -> Target... -> Choose WatchOS App ii. Run Simulator: iOS app runs as expected with gui from Briefcase tutorial. WatchOS app opens but is blank.

  2. Using Xcode (i believe this is what we're trying to do at this point) a. Fire up XCode, and create a new, blank Apple Watch project i. Call that project "Aaaa Bbbb", with an executable name of XXXXXXXX, from company YYYYYYYY.ZZZZZZZZ. b. Not sure what to do from here. It seems like we should be adding some python code somewhere, but i'm not sure where.

I think part of the confusion for me is that watchOS apps aren't stand-alone like iOS and tvOS apps are. WatchOS apps are some kind of extension (to an iOS or tvOS app) which doesn't seem to have a main.m file.

meichthys avatar Aug 20 '18 00:08 meichthys

@freakboy3742 @Ry10p
Bump.

meichthys avatar Aug 22 '18 03:08 meichthys

@meichthys Im doing some asking around, sorry about the wait ill try to figure it out also.

I think I have access to a physical watch tomorrow and will git it a try.

Could you please provide a picture of the error or the error code?

Ry10p avatar Aug 22 '18 15:08 Ry10p

@Ry10p Ok, no problem.

I'm not getting an error or error code. I'm able to build the applications fine, I'm just not sure where to put the python code for the watch app.

When you get your AppleWatch and start working on this, let me know, maybe we can chat on Gitter or irc to tag team the issue.

meichthys avatar Aug 22 '18 17:08 meichthys

@Ry10p Did you get a chance to play around with the Apple Watch today - just curious.

meichthys avatar Aug 24 '18 00:08 meichthys

@Ry10p Just wanted to check in to see if you had a chance to make any progress on this issue.

If I'm being to much of a bother, just let me know and i can buzz off and look for help elsewhere.

meichthys avatar Aug 27 '18 17:08 meichthys

Is anyone still working on this?

glyph avatar Jan 04 '19 02:01 glyph

@glyph I'm not aware of a anyone actively working on this at the moment.

freakboy3742 avatar Jan 04 '19 03:01 freakboy3742

@Glyph I haven’t had time recently to work on it, but if you wanted to tag team it, I’d still like to help out in whatever way I can.

meichthys avatar Jan 04 '19 06:01 meichthys

Thanks for the updates! Unfortunately I don't think I have the relevant expertise to start this from scratch :(

glyph avatar Jan 04 '19 07:01 glyph

@freakboy3742 In your initial comment on this issue you mentioned that:

the Python iOS support libraries support watchOS

Do you know if the 32 bit architecture is supported in those libraries? @paulproteus was helping me take a look at this and it appears that pyconfig-i386.h is required but missing from the iOS support files (at least the files that are bundled with the iOS xcode project that is generated by briefcase).

meichthys avatar Apr 07 '20 03:04 meichthys

@meichthys The watchOS build should have support for i386 and armv7k. pyconfig-i386.h won't be part of the briefcase template, though - it will be part of the watchOS support package (e.g., this one for Python 3.7).

The iOS project doesn't support i386 any more, because the only supported devices using 32-bit platforms are from the iPhone 5s era. iPhone 6 onwards use arm64.

freakboy3742 avatar Apr 07 '20 03:04 freakboy3742