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

Add support for building Realm & RealmSwift for tvOS #2506

Closed
wants to merge 9 commits into from

Conversation

segiddins
Copy link
Contributor

Note to Realm users: You may use this branch to begin preliminary tvOS development, but these builds are not suitable for production use. Expect this branch to be rebased at any time, and features could be added/removed at any point in time.

Depends upon realm/realm-core#1147.

Presumably closes #2504.

@segiddins segiddins added the pr label Sep 9, 2015
@@ -28,13 +28,16 @@ SWIFT_WHOLE_MODULE_OPTIMIZATION = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
WATCHOS_DEPLOYMENT_TARGET = 2.0;
TVOS_DEPLOYMENT_TARGET = 9.0;
CODE_SIGN_IDENTITY[sdk=iphone*] = iPhone Developer;
TARGETED_DEVICE_FAMILY = 1,2,4;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you want to add 3 to TARGETED_DEVICE_FAMILY as well. I've needed to in order to get everything to behave with other frameworks.

@segiddins
Copy link
Contributor Author

We also will need to add tvOS tests, I suppose... (unlike extensions / watchOS, it appears to allow test targets)

@mightyleader
Copy link

Just to note that in the new Beta 3 we couldn't get this build to work as a Dynamic Library.
Changing to a Static Library worked.

@jpsim
Copy link
Contributor

jpsim commented Oct 7, 2015

Thanks for the tip, @kishikawakatsumi could you update this PR to support Beta 3 when you get a chance?

@tbaranes
Copy link

I'm getting the same issue as @mightyleader by using the beta 3, but switching to static libraries didn't solve the issue for me. Any news about beta 3 support?

@kishikawakatsumi
Copy link
Contributor

I've updated this PR to support Xcode Beta 3. Thank you for being patient.

  • Use tvos-beta2 build of core
  • Fix bitcode generation
  • Fix for Xcode beta 3

@kishikawakatsumi
Copy link
Contributor

Now Realm and RealmSwift framework for tvOS can be installed with CocoaPods.

platform :tvos, '9.0'
use_frameworks!

pod 'Realm', git: 'https://github.com/realm/realm-cocoa', branch: 'seg-tvos'
pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa', branch: 'seg-tvos'

@mightyleader
Copy link

Hey,
Just downloaded and archived the new version. It crashed when run in our app with an error related to dylibs and not being able to find the link target. We rebuilt but changed the Mach-O type to Static Library and now it works.

We don't use cocoa pods so have to build manually.

FYI

@jpsim
Copy link
Contributor

jpsim commented Oct 21, 2015

@kishikawakatsumi this needs rebasing, would you have time to take care of that?

@kishikawakatsumi
Copy link
Contributor

@jpsim I'm working rebasing progress on #2721

@kishikawakatsumi
Copy link
Contributor

I've just updated #2721 to use GM build of core/framework, change default directory to Library/Caches, encryption disabled, and inter-process notification is disabled.

You can use pre-release version of Realm & RealmSwift for tvOS, like following:

pod 'Realm', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'
pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'

@mightyleader
Copy link

Hey,
Could you provide a link for non-Cocoapods installs?

Rob

On 23 Oct 2015, at 16:59, kishikawa katsumi notifications@github.com wrote:

I've just updated #2721 to use GM build of core/framework, change default directory to Library/Caches, encryption disabled, and inter-process notification is disabled.

You can use pre-release version of Realm & RealmSwift for tvOS, like following:

pod 'Realm', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'
pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'

Reply to this email directly or view it on GitHub.

@kishikawakatsumi
Copy link
Contributor

@mightyleader We don't have the plan to provide binary release of this version of Realm, sorry. You can build from source. Checkout kk-tvos branch, then execute sh build.sh tvos-swift.

@pranavss11
Copy link

@kishikawakatsumi What am i missing here?
The platform of the target ShuddleEngineTV(tvOS 9.0) is not compatible withRealm (0.96.2), which does not support tvos``

target 'EngineTV' do
    platform :tvos, '9.0’
    pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'
end

@kishikawakatsumi
Copy link
Contributor

@pranavss11 You should also specify pod Realm. RealmSwift depends on Realm. This is intended behavior of CocoaPods when installing from custom branch. Like following:

target 'EngineTV' do
  platform :tvos, '9.0'
  pod 'Realm', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'
  pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'
end

@pranavss11
Copy link

Thanks! Do you know if there is a timeline for this to get merged into the main branch? i currently have a pod spec for my private framework and I want to use it for a tvos app as well. Unfortunately, I can only specify dependencies with the name and the version and not the branch in the pod spec file which blocks me from building the app :(

CocoaPods/CocoaPods#3901

On Nov 11, 2015, at 11:08 PM, kishikawa katsumi notifications@github.com wrote:

@pranavss11 You should also specify pod Realm. RealmSwift depends on Realm. This is intended behavior of CocoaPods when installing from custom branch. Like following:

target 'EngineTV' do
platform :tvos, '9.0'
pod 'Realm', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'
pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa', branch: 'kk-tvos'
end

Reply to this email directly or view it on GitHub.

@jpsim jpsim deleted the seg-tvos branch November 24, 2015 22:37
@jpsim
Copy link
Contributor

jpsim commented Nov 24, 2015

tvOS support is being continued in #2721. We need a new release of Realm's core before we can merge that PR into master, and then we intend to release official support in the following major release (0.97).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate supporting tvOS
9 participants