Archive for November, 2008

So I Took a Screenshot on my G1…Here’s the Howto

So I compared my iPhone and my G1, and included notes on how to take a G1 screenshot, but it turns out there was another step: installing the appropriate drivers, and enabling debug on the G1.

So, to take G1 screenshots:

  1. Turn on USB debugging on the G1: Settings | Applications | Development | USB debugging
  2. Download and install the Android SDK
  3. Download and unzip the Android USB device drivers (for Windows – for Linux, see the additional instructions on the DevelopAndDebug page).
  4. Connect the device via USB, and choose “Install from a list or specified location” and choose where you unzipped the file. If you’ve already gone through this and Windows doesn’t prompt you anymore, you’ll need to open Control Panel | Administrative Tools | Computer Management | Device Manager, go down to Other Devices and choose the Android phone, then right click Properties, and choose Update Driver, then browse to the specific location…
  5. From the Android SDK, start tools/ddms.bat
  6. Your G1 should appear as the only device in the left-hand side.
  7. You can then press Ctrl-S (Device | Screen Capture) to capture a screenshot.
    G1 screenshot
  8. Breathe a sigh of relief

Comments (11)

So I used sshfs to Mount a Remote Filesystem

This is the one Linux way to edit files remotely as if they were local. For a Windows approach, see my post on WinSCP. There’s also a Windows sshfs called Dokan SSHFS.

sshfs is a user-space Linux filesystem that makes an ssh connection look like a local filesystem.

It’s trivial to use:

  1. As root (or using sudo) add your user to the ‘fuse’ group:

    # adduser butler fuse
    Adding user `butler' to group `fuse' ...
    Adding user butler to group fuse

  2. Start a new shell as the desired user (to get the updated group list), make a mount point, and start sshfs. Note that sshfs will prompt you to accept the remote key (not shown) if this user hasn’t previously connected to this remote account.

    $ mkdir soi
    $ sshfs soi's password:
    $ ls soi/images
    changeDirectories.jpg keepRemoteSynced.jpg updatingFiles.jpg
    directoriesSynced.jpg session.jpg watchForChanges.jpg
    firstSession.jpg updateFiles.jpg

  3. Read and update files as if they were local – but with some transfer lag…

If you don’t want to deal with the lag every time you read or write the file, you’ll probably want to use scp or rsync to copy the files over when you need them on the remote machine – and you’ll probably want to use ssh-agent and ssh-add to set up key-based authentication, so you don’t have to type your password every time. You can even put the scp or rsync calls in your Makefile…

Comments (2)

So I used WinSCP to Keep a Remote Directory Up-to-Date

Mononofu reminded me I hadn’t talked about how to keep remote directories in sync. This is the windows version. For a Linux version, see my post on sshfs.

So, to work on files locally on Windows, but have them automatically copied to a remote directory, use WinSCP.

  1. Download WinSCP 4.17 and install it
  2. Run WinSCP
  3. Enter info to connect to the remote host (like your iphone)Session parameters
  4. On your first connect, WinSCP won’t recognize the key of the remote system, so just accept it. If you see this prompt later, it either means your remote system got a new key (e.g., reflashed the phone and re-jailbroke it), or somebody could be trying to intercept your communications. Prompt to accept remote host key
  5. Change directories to the local and remote directories you want to keep synced. Change directories
  6. Choose Commands | Keep Remote Directory up to Date (Ctrl-U). Keep Remote Directory up to Date (Ctrl-U)
  7. Choose options for synchronization, and do a full synchronization to get things started. Watch for changes
  8. Make changes to the files on your local machine. Update local files
  9. WinSCP notices the changes and pushes them to the remote machine. Updating files
  10. The directories are kept in sync. Directories synced

Comments (5)