tkconclient
Not logged in

tkconclient is described in the Tcl Wiki as means for remote access to another Tcl interpreter using the tkcon console.

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

    package require tkconclient
    tkconclient::start 12345

meaning that TCP port 12345 is accepting incoming connections from tkcon 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:

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

My own ~/.wishrc is somewhat larger:

    # 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 ...