Artifact [602ac3f743]
Not logged in

Artifact 602ac3f743f005df5ce23d7096e0112d18277f52:

Wiki page [tkconclient] by chw 2014-09-20 08:42:02.
D 2014-09-20T08:42:02.985
L tkconclient
P 162508ce4d02746be144b643ec9de03812989547
U chw
W 2585
<tt>tkconclient</tt> is described in the <a href="http://wiki.tcl.tk/14701">Tcl Wiki</a> as means for remote access to another Tcl interpreter using the <a href="http://wiki.tcl.tk/1878"><tt>tkcon</tt></a> console.

For an interactive [AndroWish] this can be achieved by adding these lines to <tt>~/.wishrc</tt> (the Tcl script getting sourced when an interactive <tt>wish</tt> or [AndroWish] is started)

<verbatim>
    package require tkconclient
    tkconclient::start 12345
</verbatim>

meaning that TCP port 12345 is accepting incoming connections from <tt>tkcon</tt> on all interfaces. If the Android device is connected to the development system using an USB cable, it is possible to redirect port 12345 to that USB connection:

<verbatim>
    # on development system, instruct adb (Android Debug Bridge from SDK)
    # to forward TCP port 12345
    adb forward tcp:12345 tcp:12345
</verbatim>

My own <tt>~/.wishrc</tt> is somewhat larger:

<verbatim>
    # Start socket for tkcon
    #
    # When used over ADB USB debug connection
    # the TCP port 12345 must be forwarded using
    #
    #   adb forward tcp:12345 tcp:12345

    catch {
        package require tkconclient
        tkconclient::start 12345
    }

    # Start dropbear SSH/SFTP daemon using librun.so
    # which is on the path of executable programs and
    # located in the directory where all AndroWish
    # shared libraries are installed.
    #
    # When used over ADB USB debug connection
    # the TCP port 12346 must be forwarded using
    #
    #   adb forward tcp:12346 tcp:12346
    #
    # The public key of the development system
    # must have been copied to $env(HOME)/.ssh/authorized_keys
    # of the Android device. $env(HOME) is usually /data/data/tk.tcl.wish/files
    #
    # This allows to SSH into the device as the AndroWish user
    # or to SFTP to/from the device as the AndroWish user.
    # That poor AndroWish user is the uid under which the Android
    # package manager decided to install the AndroWish APK.

    catch {
        exec librun.so libdropbear.so dropbear_main -R -p 12346
    }

    # other goodies accessible through librun.so
    #
    # tclsh:        librun.so libtcl.so tclsh ...
    # sqlite3:      librun.so libtclsqlite3.so sqlite3_shell ...
    # ssh:          librun.so libdropbear.so cli_main ...
    # scp:          librun.so libdropbear.so scp_main ...
    # dropbearkey:  librun.so libdropbear.so dropbearkey_main ...
    # curl:         librun.so libcurl.so curl_main ...
</verbatim>

Z 318fe4947852f4ce35aa6d38e916862e