如何建立&在没有IDE的情况下部署Samsung SmartTV应用程序(例如:在Linux上) [英] How to build & deploy a Samsung SmartTV app without the IDE (e.g: on Linux)

查看:211
本文介绍了如何建立&在没有IDE的情况下部署Samsung SmartTV应用程序(例如:在Linux上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

我想尝试使用Samsung SmartTV SDK 2.5构建一个概念验证应用程序(我有2011款电视 - UA55D8000)。

I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000).

不幸的是,SDK有两种版本,似乎只适用于Microsoft Windows。这很奇怪,因为没有理由这样:电视本身运行Linux,应用程序用JavaScript编写。

Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run Linux and applications are written in JavaScript.

这提出了两个问题:


  1. 由于我家中没有Microsoft Windows,因此我无法使用SDK附带的构建环境(也不是TV模拟器)。 (SDK文件本身只是JavaScript)

  1. As I don't have Microsoft Windows at home, I can't use the build environment (nor the TV emulator) that come with the SDK. (The SDK files themselves are just JavaScript)

即使我可以访问Windows,也很难实现构建和自动化。无需访问传统构建工具即可测试应用程序(例如:Make,Ant,Autotools等)

Even if I had access to Windows, it's very hard to automate building & testing of the Apps without access to traditional build tools (e.g: Make, Ant, Autotools, etc)

怎么能我在Linux上构建三星智能电视应用程序? (即:不使用SDK附带的基于Windows的构建工具)

How can I build Samsung Smart TV Applications on Linux? (i.e: without using the Windows-based build tools that come with the SDK)

我是什么到目前为止已经找到了:

从我可以收集到的,JavaScript模式应用程序只是包含XML配置文件,一个或多个JavaScript文件的zip文件(包括为平台SDK函数提供的JavaScript接口库),以及任何所需的资源(HTML,图像等)。

From what I can gather, a JavaScript-mode application is simply zip file containing an XML config file, one or more JavaScript files (including supplied JavaScript interface libraries for platform SDK functions), and any required assets (HTML, images, etc).

另外,根据我的收集,部署涉及放置电视可访问的Web服务器网络上的zip文件和XML清单文件,在电视上以开发方式登录,并将应用程序同步到电视上已安装的应用程序。

Also, from what I gather, deployment involves placing the zip file and an XML manifest file on a web-server network accessible to the TV, logging in as 'develop' on the TV and 'syncing' the application to the installed applications on the TV.

有人能指出我的完整部署要求的来源吗? app捆绑要求?或者甚至只是一个工作样本?

Could someone point me to a source for the full deployment requirements & app bundle requirements? Or even just a working sample?

推荐答案

我在Ubuntu机器上设置开发环境取得了一定的成功我想在这里分享我的方法给任何想要做同样事情的人。这个答案旨在与平台无关,因此相同的建议应该适用于任何完全成熟的操作系统。

I've had a reasonable amount of success setting up a development environment on my Ubuntu machine and I'd like to share my methods here for anyone looking to do the same. This answer is intended to be platform independent, so the same advice should work on any fully fledged operating system.

首先,关于应用结构的问题假设是正确的。 JavaScript应用程序包含以下项目:

First off, the question's assumptions regarding app structure are correct. A JavaScript application consists of the following items:


  • config.xml ,一个定义各种设置的简单配置文件部署信息。请参阅 编写config.xml文件 在官方开发者网站上。

  • widget.info ,这是一个非常小的文件,其中有几行用于定义应用程序正文的不透明度。全屏应用程序可能不需要这样做。

  • index.html ,您应用程序的主要HTML文件。

  • 图像,声音和其他资源

  • config.xml, a simple configuration file defining various settings and deployment information. See Writing the config.xml File on the official developer site.
  • widget.info, a very small file with a few lines used to define the opacity of the application's body. This may not be required for full-screen applications.
  • index.html, the main HTML file for your application.
  • Images, sounds and other resources.

您可以使用自己喜欢的编辑器编写这些文件。我很高兴使用 vim 和我的JS和CSS的linting插件。

You can write these files using your favourite editor. I'm happily using vim with linting plugins for my JS and CSS.

从SDK版本4.0开始,现在可以使用Linux版本的仿真器。这使您可以像在2011-2013电视上看到的那样测试您的应用。对于较旧的电视,您可以在Wine中运行SDK 1.5的模拟器,但属于SDK 2.0和较新的的模拟器将无法运行

As of version 4.0 of the SDK, a Linux version of the emulator is now available. This allows you to test your apps as they would appear on 2011-2013 TVs. For older TVs, you can run SDK 1.5's emulator in Wine, but emulators belonging to SDK 2.0 and newer will not run.

可以在Windows虚拟机中运行模拟器,而且,有点诡计,你可以让模拟器使用您自己的应用程序文件夹来查找应用程序。这涉及与虚拟机共享开发文件夹,然后创建指向这些文件夹的符号链接,替换SDK安装目录中的apps文件夹。有关此过程的快速概述,请参阅标题为 ?将其替换为Mac上您最喜欢的编辑器!

It is possible to run the emulators in a Windows virtual machine, and, with a little bit of trickery, you can make the emulators use your own application folder to look for apps. This involves sharing your development folders with your virtual machine, then creating a symbolic link to those folders, replacing the "apps" folder inside the SDK's installation directory. A quick overview of this process is available in an article titled, Your Windows IDE sucks? Replace it with Your Favorite Editor on the Mac!

三星智能电视具有内置的开发人员帐户,允许您通过计算机发送应用程序,以便在电视上进行实时测试。输入部署服务器的IP地址,电视将在该服务器上查找名为 widgetlist.xml 的文件。格式示例如下:

Samsung Smart TVs have a built-in developer account that allows you to send an application over from your computer for live testing on the television itself. You enter the IP address of your deployment server and the TV will look for a file called widgetlist.xml on that server. An example of the format is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<rsp stat="ok">
  <list>
    <widget id="MyTVApp">
      <title>MyTVApp</title>
      <compression size="3383543" type="zip"/>
      <description>A basic application for Samsung TVs</description>
      <download>http://192.168.1.83/Widget/MyTVApp_0.1_America_20120709.zip</download>
    </widget>
  </list>
</rsp>

之后,它将使用中的URL下载列出的每个应用程序;下载> 标签。您所要做的就是压缩文件,相应地修改 widgetlist.xml ,并确保这两个文件都托管在您计算机上运行的Web服务器上。您可以使用Apache,lighttpd或其他任何东西。我有一个小的node.js / connect应用程序,它将根据我在标有 deploy 的目录中的zip文件动态构建 widgetlist.xml

After that, it will download each app listed using the URL in the <download> tag. All you have to do is zip up the files, modify the widgetlist.xml accordingly and make sure both files are hosted in a web server running on your machine. You can use Apache, lighttpd or anything. I have a small node.js/connect app that will build the widgetlist.xml dynamically based on the zip files I have in a directory labelled deploy.

所以你有它。没有Windows,三星智能电视应用的开发并非不可能。事实上,有很多选择。万岁!

So there you have it. Development of Samsung Smart TV apps is not impossible without Windows. In fact, there's quite a few options available. Hooray!

这篇关于如何建立&amp;在没有IDE的情况下部署Samsung SmartTV应用程序(例如:在Linux上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆