Ubuntu – Shell on ubuntu touch

ubuntu-touch

I want to test some C-code on Nexus 7 under Ubuntu touch. Before installing Ubuntu touch on the tablet, I have some questions :

Is it possible to compile (gcc ?) and run the code directly in the tablet in the same way as on a laptop ?

Is there a shell where the command-line works as on laptop or desktop computer, on Ubuntu Touch ?

Best Answer

The answer is Yes (for both questions), but before testing your code on the Nexus 7 (2013), you'll need to run Utopic (14.10) on your laptop/desktop to get access to the latest development tools.

  1. Follow the installation steps (using the development channel to get a 14.10 image).

  2. Install the required packages to manage your device:

    sudo apt-get install ubuntu-device-flash phablet-tools
    
  3. Install the SDK

    sudo apt-get install ubuntu-sdk
    
  4. Connect your device and enable read-write mode (using the SDK):

    enter image description here

  5. Push a sample code to your device (hello.c):

    $ adb push hello.c /home/phablet
    1 KB/s (82 bytes in 0.041s)
    
  6. Start a phablet shell connection, install gcc and libc6-dev (root password is phablet) and compile your code on the target:

    sylvain@sylvain-ThinkPad-T430s:~$ phablet-shell 
    start: Job is already running: ssh
    /home/sylvain/.ssh/known_hosts updated.
    Original contents retained as /home/sylvain/.ssh/known_hosts.old
    4 KB/s (200 bytes in 0.040s)
    Warning: Permanently added '[localhost]:2222' (RSA) to the list of known hosts.
    Welcome to Ubuntu Utopic Unicorn (development branch) (GNU/Linux 3.4.0-3-flo armv7l)
    
     * Documentation:  https://help.ubuntu.com/
    Last login: Wed Jul  9 21:29:20 2014 from localhost.localdomain
    phablet@ubuntu-phablet:~$ sudo apt-get update
    [sudo] password for phablet: 
    
    [...]
    
    phablet@ubuntu-phablet:~$ sudo apt-get install gcc libc6-dev
    
    [...]
    
    phablet@ubuntu-phablet:~$ gcc -Wall hello.c -o hello
    phablet@ubuntu-phablet:~$ ls
    Documents  Downloads  hello  hello.c  Music  Pictures  Videos
    phablet@ubuntu-phablet:~$ ./hello
    Hello, world!
    phablet@ubuntu-phablet:~$ 
    
Related Question