Skip to content

Instantly share code, notes, and snippets.

@laat
Last active March 9, 2024 11:06
Show Gist options
  • Save laat/2b7107298593dca650062b7678279386 to your computer and use it in GitHub Desktop.
Save laat/2b7107298593dca650062b7678279386 to your computer and use it in GitHub Desktop.
Notes on Tizen commands that might work
sdb connect <ip>:<port> # connect to TV
sdb -s <deviceName> capability # get <installationPath>
# build
tizen cli-config "default.profiles.path=<profile_path>"
tizen build-web -out .buildResult -- <source-dir>
tizen package --type wgt --sign profileName -- <source-dir>/.buildResult # extract <package-file>
mv <package-file> .
rm -rf <source-dir>/.buildResult
# install
sdb -s <deviceName> push tizen/build/<0000.name>.wgt <installationPath>
sdb -s <deviceName> shell 0 vd_appinstall <0000.name> <installationPath>/<0000.name>.wgt
# uninstall
sdb -s <deviceName> shell 0 vd_appuninstall <0000.name>
# launch app (debug)
sdb -s <deviceName> shell 0 debug <0000.name> # get <port>
sdb -s <deviceName> forward --remove tcp:<port>
sdb -s <deviceName> forward tcp:<port> tcp:<port>
# then open Chrome on http://localhost:<port>
# launch app
sdb -s shell 0 was_execute <0000.name>
@simenbrekken
Copy link

yarn tool tizen package
~/tizen-studio/tools/emulator/bin/em-cli launch -n T-samsung-5.0-x86
tizen install -n NrkTvDev.wgt -t T-samsung-5.0-x86
tizen run -p 0000000001.NrkTvDev -t T-samsung-5.0-x86
sdb -s emulator-26101 shell 0 debug 0000000001.NrkTvDev
sdb -s emulator-26101 forward tcp:7011 tcp:7011

@laat
Copy link
Author

laat commented Feb 18, 2019

write a websocket-livereload tizen plugin?

class TizenPlugin {
  apply(compiler: webpack.Compiler) {
    compiler.hooks.done.tap('TizenPlugin', stats => {
      Object.keys(stats.compilation.assets).forEach(asset => {
        console.log('TODO: upload file over websocket');
        console.log({
          asset,
          location: stats.compilation.assets[asset].existsAt,
          source: stats.compilation.assets[asset].source().substr(0, 20),
        });
      });
    });
  }
}

@laat
Copy link
Author

laat commented Feb 26, 2019

ping -c 1 192.168.100.1 > /dev/null 2>&1 && arp -a | grep -e "$THEM)" | awk '{print $4}'
and wake on lan?

@AndreasNasman
Copy link

AndreasNasman commented Jun 8, 2022

Probably a bit late to the party, but how did you figure out what preceding commands are valid to give sdb shell 0? I can't find any documentation on vd_appinstall, vd_appuninstall, debug, was_execute, etc. that you use in your examples.

I also don't understand what the 0 in e.g. sdb shell 0 debug means. I suppose it means to not forward the preceding commands to the remote shell (debug or 0 aren't Unix programs on the device) but instead, have the sdb program itself interpret what debug means. If I run

/sdb shell 0 debug
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `/usr/bin/app_launcher --start (null) --web-debug'

you can see that /usr/bin/app_launcher --start (null) --web-debug is the actual command it tries to run. By the looks of it, debug works as a switch to run that particular command; what other switches are available is unclear to me.

This contains some documentation, but it's far from complete.

@laat
Copy link
Author

laat commented Jun 8, 2022

I'm not entirely sure, I'm no longer involved in the development of tizen apps.

I think i reverse engineered wits to find the commands

https://github.com/Samsung/Wits/blob/c18cf03eced66aa66c3603c94fccf4c14d193f00/lib/appLaunchHelper.js

@laat
Copy link
Author

laat commented Jun 8, 2022

/sdb shell 0 debug

I think you need to add a last argument for the application id you want to debug.

image

<tizen:application id="your.id" ...>
sdb shell 0 debug your.id

@AndreasNasman
Copy link

AndreasNasman commented Jun 8, 2022

Thanks for the reply!

I think i reverse engineered wits to find the commands

Ok, that's also what I ended up doing. Also asked Samsung about the commands but they had no good answer.

I think you need to add a last argument for the application id you want to debug.

To debug an app you need to include the ID, yes. I intentionally left it out generate the error message displaying what command it's translated to on the client (the TV) 🙂.

sdb shell 0 debug packageId.appId runs /usr/bin/app_launcher --start packageId.appId --web-debug on the client. Where the translation from the former command to the latter happens is a mystery to me. I suspect it's by sdb, either on the client or on the host (your computer).

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