Open freakboy3742 opened 8 years ago
I would like to work on this issue
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 This is fixed now, correct?
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).
Is this being managed? or may I help? please
@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 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 :).
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.
LOVE IT
Ill start right away!
Thank you! -Ryan Carl
@freakboy3742
Update on the Project: Steps I have taken so far...
fire up XCode, and create a new, blank Apple Watch project
I've called that project "Aaaa Bbbb", with an executable name of XXXXXXXX, from company YYYYYYYY.ZZZZZZZZ.
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 Correct - A Hello World app is the next step.
@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
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.
@meichthys
@Ry10p Ok. I'll see what I can do and will be in touch if (when) i run into some roadblocks.
@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?
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
Could you possibly detail your process?
Are you building for tvOS with Beeware Breifcase, then importing the resulting build into Xcode to run?
@Ry10p
I've tried it multiple ways:
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.
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.
@freakboy3742 @Ry10p
Bump.
@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 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.
@Ry10p Did you get a chance to play around with the Apple Watch today - just curious.
@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.
Is anyone still working on this?
@glyph I'm not aware of a anyone actively working on this at the moment.
@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.
Thanks for the updates! Unfortunately I don't think I have the relevant expertise to start this from scratch :(
@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 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 Thanks for the link to the WatchOS support package. That's what i was looking for.
@freakboy3742 Thanks for the link to the WatchOS support package. That's what i was looking for.
Any luck with this @meichthys ?
@mobile-appz I felt like I was making some progress but it was a little over my head. I was never able to get a watchOS app to compile and run python.
@mobile-appz I felt like I was making some progress but it was a little over my head. I was never able to get a watchOS app to compile and run python.
@meichthys thanks very much for the update. Just in case you haven't seen this already have had a response from @freakboy3742 here too: https://github.com/beeware/Python-Apple-support/issues/87
@mobile-appz, @freakboy3742's response in #87 is spot on. The watchOS projects in Xcode are different than iOS. Initially in XCode you could only build a watchOS app as an iOS app 'extension', but recently (i think since watchOS6) it is possible to build standalone watchOS apps which should make integration with beeware\briefcase somewhat more straightforward. My issue was that I had little previous experience with building watchOS apps and am not familiar enough with the structure of XCode projects to figure out where to put things and how to configure the XCode project settings. If you have some prior experience, keep the ball rolling on this! It would be super cool to see python running on an AppleWatch!
Hi @meichthys pleased to confirm a basic "hello world" app with Python is working on Apple Watch series 3. It simply prints "Hello World" to the console. Please see some more info here about how this was set up in Xcode. The main thing was linking the .a files of the binaries correctly in Xcode, and setting up the header search paths correctly in order that Xcode is able to find python. https://github.com/beeware/Python-Apple-support/issues/87#issuecomment-633051207
Great news! I tried liking the .a files and mapping the headers but I must have missed some! I’ll take a look at your write up in the other issue and give it a shot later today.
Now that the Python iOS support libraries support watchOS, Briefcase should also support that platform.
This will involve: