July 3, 2023

How do I get photos off my phone - ADB (Google Pixel 6, 2023)

No, I still can't just grab a USB cable, connect my phone, and have it appear as a mass storage device.

Using ADB is sort of using the big sledge hammer for the job, but what do I care? If they don't make it sensible and easy, I take pride in forcing the issue.

I am doing android development. This means I have adb (Android Debug Bridge) on my linux desktop. It also means I have enabled developer options on my phone and enabled USB debugging. With that already set up, the following is more or less straightforward.

I use a USB-A to USB-C cable to connect my phone. Be warned that some cables are charging cables only and my work only partially for data transfer or not at all.

Where are the photos?

I use "adb shell". It announces:
[tom@trona tom]$ adb shell
* daemon not running; starting now at tcp:5037
* daemon started successfully
oriole:/ $
I have no idea who and what "oriole" is.
I explore around a bit and it looks like the photos are in the /sdcard/DCIM/Camera directory.

Copy all of them

I do this:
[tom@trona tom]$ mkdir Pixel
[tom@trona tom]$ cd Pixel
[tom@trona Pixel]$ adb pull /sdcard/DCIM/Camera .
/sdcard/DCIM/Camera/: 96 files pulled, 0 skipped. 33.4 MB/s (350196271 bytes in 9.995s)
It creates the directory Camera and copies all of the files.
Fast and easy.

The files have names like "PXL_20220506_234508555.jpg" and vary from 1.5 to 7.0 megabytes in size. Most are 2 or 3 megabytes.

identify PXL_20230703_161142129.jpg 
PXL_20230703_161142129.jpg JPEG 4080x3072 4080x3072+0+0 8-bit sRGB 1.54911MiB 0.000u 0:00.000

Get these into lightroom

I am spoiled by using lightroom to view and edit photos. Having a bunch of JPG files in a directory on my linux machine is a step forward, but only that.

I have a windows PC to run lightroom. It mounts filesystems from my linux machine over the network. The first thing I do is to make an empty directory for them using lightroom.

I launch LrC (lightroom classic), and create a folder 2023/2023_pixel6.
On my linux machine this is /u1/Camera/lightroom/2023/2023_pixel6
I do this:

cd /u1/Camera/lightroom/2023/2023_pixel6
cp /u1/home/tom/Pixel/Camera/* .
cd /home/tom
rm -rf Pixel
I'll note that I could have had adb just dump the files directly into this lightroom folder, and that may be what I will do in the future.

Dealing with these via lightroom

A number of decisions spring up. I usually would rename all these files to 2023_pixel6_xx.jpg. But since I anticipate copying more files from my phone in the future, it makes some sense to keep the names as is. For now doing nothing seems to make sense.

In lightroom I use import, go to the 2023/2023_pixel6 directory and let it rip.


Have any comments? Questions? Drop me a line!

Tom's Cell Phones / [email protected]