Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for tvOS (AppleTV) #918

Closed
2 tasks done
snej opened this issue Sep 21, 2015 · 22 comments
Closed
2 tasks done

Build for tvOS (AppleTV) #918

snej opened this issue Sep 21, 2015 · 22 comments
Assignees
Milestone

Comments

@snej
Copy link
Contributor

snej commented Sep 21, 2015

We should have a build of Couchbase Lite for tvOS (AppleTV).

  • Fix build errors — there are some deprecation warnings.
  • Set up targets to build a framework that can be used with simulator and device, as with iOS
@brendand
Copy link
Contributor

I'm curious about this. If there's no storage space available on Apple TV, how is running Couchbase Lite going to work? It was my understanding that you could only use CloudKit or iCloud for storage.

@snej
Copy link
Contributor Author

snej commented Sep 22, 2015

It appears that you can write to local storage, although only to your app sandbox's Caches directory. The data you write there may be deleted at any time after the app quits; from the info I've found, it will currently happen if the device is rebooted, or if storage starts to get full.

@snej
Copy link
Contributor Author

snej commented Sep 22, 2015

The unit we got has about 26GB of free space on it, so they've got to be planning on developers putting something on it...

@brendand
Copy link
Contributor

I just figured the storage was for movies/music/app binaries. It would be cool though. I would love to build an Apple TV version of my Tap Forms Organizer app, possibly just as a dashboard service of some sort. Obviously not good for data entry, but great for displaying aggregate data.

@snej snej added in progress and removed backlog labels Sep 25, 2015
@snej snej self-assigned this Sep 25, 2015
@zgramana zgramana added this to the 1.2 milestone Sep 25, 2015
@snej
Copy link
Contributor Author

snej commented Sep 30, 2015

This is basically done; I just haven't been able to get the unit tests to build yet. It's in the branch release/1.1.1-appletv.

@cflorion
Copy link
Contributor

Cooool ! :)

One question, you managed to build, but did you manage to run a sample on the device ?
Thanks! Can't wait to try that out :)

@snej
Copy link
Contributor Author

snej commented Sep 30, 2015

I love you guys' enthusiasm, but post it on the mailing list instead! 😺 It's kind of getting in the way of the progress info in this issue report.

@snej
Copy link
Contributor Author

snej commented Sep 30, 2015

For the sake of completeness I'll add status info that I posted to the mailing list last week:

  • For development purposes, you can use the iOS Couchbase Lite framework in tvOS apps, since tvOS is mostly the same as iOS. But you’ll get a linker warning complaining that it’s not a “real” tvOS binary. In the near future we’ll release a build that’s been officially compiled for tvOS.
  • AppleTV apps cannot write to the Application Support directory, only the Caches directory. You’ll need to instantiate the CBLManager with a custom path pointing to that directory, otherwise it’ll fail when trying to create a database. (In the upcoming official build, I’m putting in an #ifdef to have CBLManager default to the Caches directory.)
  • Good news: the Caches directory seems more persistent than Apple’s docs imply. I’ve run a simple app that creates a database there, and the database persists across app launches and across device restarts. I suspect it will get dumped when storage fills up, but I haven’t tested this yet.

@snej
Copy link
Contributor Author

snej commented Sep 30, 2015

Filed an internal Jira ticket to get the build set up: https://issues.couchbase.com/browse/CBLT-385

@zgramana zgramana added ready and removed in progress labels Oct 2, 2015
@cflorion
Copy link
Contributor

cflorion commented Oct 5, 2015

Hmm strange, I tried to compile it in order to get the Framework (I used the target CBL tvOS Empty App) but the compile fails since I'm missing CBForect submodule. When I update the submodules I get this message:

fatal: reference is not a tree: 1a1fbf9aa8d80031db2e7f773689b58d77ac984e
Unable to checkout '1a1fbf9aa8d80031db2e7f773689b58d77ac984e' in submodule path 'vendor/CBForest'

Is it working for you ?
Thanks ;)

@snej
Copy link
Contributor Author

snej commented Oct 5, 2015

Sorry about that — I made a change to CBForest but hadn’t pushed it to Github. Please try again and it should work now.

@snej snej added in progress and removed ready labels Oct 9, 2015
@snej
Copy link
Contributor Author

snej commented Oct 9, 2015

Working on this again. I got the "CBL tvOS Empty App" target to run, and got the unit tests to build too. The tests pass on the simulator but fail on the device, and I'm looking at the failures, which are very very strange.

@cflorion
Copy link
Contributor

Just so you know, I haven't tried the unit tests, but I tried it with my tvOS app and it's working like a charm :)
I did that in 2 minutes to I haven't look and logs or warnings, I'll do that and will tell you.
Thanks!

@SebastianBO
Copy link

Got our Apple TV some days ago, thanks @snej and @cflorion @brendand ..success here too 👍

@snej
Copy link
Contributor Author

snej commented Oct 15, 2015

The test failures turned out to be a known issue in 1.1.1 (we had them on iOS too, but for various reasons they weren't fixed.)

I've updated the release/1.1.1-appletv branch with the fixes to make the unit tests work. I also made some trivial changes to the Building Couchbase Lite wiki page, mostly just to note that tvOS is supported and name the target to build.

@snej
Copy link
Contributor Author

snej commented Oct 15, 2015

Next step is for @michaelkwok to add a builder for this. One obstacle is that you need Xcode 7.1 to build for tvOS, and that's still in beta, so they may want to hold off until it's GA.

@snej snej assigned michaelkwok and unassigned snej Oct 15, 2015
@michaelkwok
Copy link
Contributor

I will keep an eye on this. I am in the process of bringing up a new build server for Xcode 7.

@snej
Copy link
Contributor Author

snej commented Oct 15, 2015

Ship date for the Apple TV is "late October", and the GA of Xcode 7.1 should be about a week before that to give developers time to rebuild with it and submit their apps. So I'd start expecting it anytime starting about a week from now...

@zgramana zgramana added the docs label Oct 16, 2015
@zgramana zgramana assigned snej and unassigned michaelkwok Oct 16, 2015
@snej snej removed their assignment Oct 23, 2015
@snej
Copy link
Contributor Author

snej commented Oct 23, 2015

The GA of Xcode 7.1 was released yesterday. It can be downloaded/updated via the Mac App Store.

@amg1976
Copy link

amg1976 commented Dec 4, 2015

Hi guys.

Tried to compile the framework based on these instructions (https://github.com/couchbase/couchbase-lite-ios/wiki/Building-Couchbase-Lite) and it worked.

But when trying to use it inside the app, I'm getting a lot of errors:
couchbase-errors.txt

Can you help me?

Thanks.

@amg1976
Copy link

amg1976 commented Dec 4, 2015

Fixed by adding -lstdc++ in Other Linker Flags.

@snej
Copy link
Contributor Author

snej commented Dec 4, 2015

Or you can add libstdc++ to the Link With Libraries section of the Build Phases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants