I got my first Android phones a few weeks ago. In the last few days, I tried to transfer files directly between my phone to my computer. I first tried sysutils/mtpfs without success. Then I stumbled upon devel/android-tools-adb. Using this port, I was able to transfer files between my phone to my computer. Here are the steps I took:
Step 1: Install devel/android-tools-adb.
Step 2: Connect your Android device to your computer using USB cable. Make sure your device is detected by FreeBSD. You should see something like the following in /var/log/messages.
This is my phone.
This is my Nook Simple Touch.
For my phone I had to enable USB debugging using the procedures outlined at developer.android.com:
Step 4: Now you have connected your device with FreeBSD. You can transfer files between them using
You could also get a shell in your device using
Step 1: Install devel/android-tools-adb.
Step 2: Connect your Android device to your computer using USB cable. Make sure your device is detected by FreeBSD. You should see something like the following in /var/log/messages.
Code:
kernel: ugen0.5: <LG Electronics Inc.> at usbus0
devd: Executing 'logger Unknown USB device: vendor 0x1004 product 0x61f9 bus uhub3'
root: Unknown USB device: vendor 0x1004 product 0x61f9 bus uhub3
devd: Executing 'logger Unknown USB device: vendor 0x1004 product 0x61f9 bus uhub3'
Code:
kernel: ugen0.5: <BN> at usbus0
kernel: umass0: <BN NOOK SimpleTouch, class 0/0, rev 2.00/2.16, addr 5> on usbus0
kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000
kernel: umass0:8:0:-1: Attached to scbus8
devd: Executing 'logger Unknown USB device: vendor 0x2080 product 0x0003 bus uhub3'
kernel: da6 at umass-sim0 bus 0 scbus8 target 0 lun 0
kernel: da6: <B&N NOOK SimpleTouch 0100> Removable Direct Access SCSI-2 device
kernel: da6: 40.000MB/s transfers
kernel: da6: 239MB (491488 512 byte sectors: 64H 32S/T 239C)
kernel: da6: quirks=0x2<NO_6_BYTE>
root: Unknown USB device: vendor 0x2080 product 0x0003 bus uhub3
aaa kernel: da7 at umass-sim0 bus 0 scbus8 target 0 lun 1
aaa kernel: da7: <B&N NOOK SimpleTouch 0100> Removable Direct Access SCSI-2 device
aaa kernel: da7: 40.000MB/s transfers
aaa kernel: da7: 3779MB (7741311 512 byte sectors: 255H 63S/T 481C)
aaa kernel: da7: quirks=0x2<NO_6_BYTE>
For my phone I had to enable USB debugging using the procedures outlined at developer.android.com:
Step 3: Issue the commandTo access these settings, open the Developer options in the system Settings. On Android 4.2 and higher, the Developer options screen is hidden by default. To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom.
$ adb devices
. Please note that you do not need to be root to issue this command. I am not sure what effect this may have though. This command may take a few minutes to complete. If successful, you will see something like:
Code:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
your_device_number device
adb pull
and adb push
. These commands act as cp -r
.You could also get a shell in your device using
adb shell
. There are even commands to backup and restore data of your devices. A basic description of adb options is provided by adb help
. You can see the full description of the adb command at developer.android.com.