A while back, I was part of a Twitter thread where it was proposed that Vertigo had been surpassed as “the best San Francisco movie” by The Last Black Man in San Francisco. I took issue, as this smacks of both recency bias and virtue-signaling. As the thread unfolded, it became clear that such a statement was best done by decade, to spread the love (and hopefully deflate some of the more charged responses). Look for these on your streaming services is you need something to watch while we quarantine.
It’s important to distinguish between films that are simply set in San Francisco, and movies that meaningfully connect with San Francisco. I will incline towards the latter.
So, my take. The number of SF films that I have not seen far outnumbers those that I have, so if there are films I should be listing here that I haven’t, please add them to the comments.
1920s
Greed (1924) — only partially set in San Francisco, it’s a remarkable portrayal of early California, all shot on location throughout the state. And a criticism of capitalism and the insanity it inspires.
1930s
Shame on me, but I don’t think I’ve seen any 1930s film set in SF.
1940s
Thieves Highway — Among my favorite films, and the best film directed by my son’s namesake, Jules Dassin. The story goes from the Central Valley (the hero works in agriculture) to San Francisco. For SF locals, most notable for how it used the location of the San Francisco Produce Market (where the Embarcadero Center now is). It’s also just a great movie.
Honorable mentions:
Shadow of  a Doubt — my favorite Hitchcock film, set (and, in part, shot) in Santa Rosa.
D.O.A. — A noir classic with many scenes shot in San Francisco.
The Lady from Shanghai — Can’t say it’s truly ‘of’ San Francisco, but the finale, set in Playland-by-the-Beach (and famous for the hall of mirrors sequence), is worth admission.
The Maltese Falcon — the obvious choice, but I think these other films are better, and this movie is really about soundstages, not locations.
 1950s
Vertigo — One of the best movies ever made, and makes extraordinary use of real San Francisco (and other Bay Area) locations. It doesn’t necessarily feel like San Francisco, but it’s power cannot be denied.
Honorable mention:
The Lineup —Tight, surprisingly gritty crime film from the director who would later give you Dirty Harry. For SF-heads, truly delightful for it’s locations, in particular Sutro Baths before it burned down.
1960s
Bullitt — Could there be another choice? While it might not be the most “San Francisco” or films, it’s iconic car chase, which exploited SF’s distinct topography (even if it didn’t make geographic sense cut-to-cut) sets it apart.
Honorable mention:
Point Blank — Another personal favorite, it’s set mostly in Los Angeles, but uses the bay, Alcatraz, and Fort Point to remarkable effect. It’s also an art film masquerading as a crime drama.
1970s
Invasion of the Body Snatchers — This may be the most truly San Francisco film so far, in terms of something that could have only be set in SF, drawing from its culture. Also, remarkable use of locations, early Jeff Goldbum, and Leonard Nimoy without the ear tips.
Honorable mention:
Time After Time — A trifle (about Sherlock Holmes chasing Jack the Ripper using a time machine that brings them to modern-day San Francisco), but enjoyable. Written and directed by Nicholas Meyer, who would use San Francisco to great effect in Star Trek IV: The Voyage Home.
Dirty Harry — Not so much about peace and love, but still very much of San Francisco after the ‘season of the witch.’ A taut police drama inspired by the Zodiac killings, it created an iconic character who went on to helm a franchise.
Dishonorable mention:
The Conversation — A hamhanded misguided attempt at a European art film. It’s only redeeming qualities are how it uses San Francisco locations. The movie itself is a ponderous bore. And a cheat.
1980s
Star Trek IV: The Voyage Home — This is my list, okay? Also, from what I can tell, the 80s were not a great time for movies set in SF. STIV is lightweight, but legitimately entertaining, and makes superlative use of the Bay Area.
1990s
Sneakers — Prrrrobably the best “computer hacker” movie (though War Games holds up surprisingly well), it is a deeply Bay Area film, not only San Francisco, but uptown Oakland and the peninsula as well.
Honorable mention:
Crumb — Eye-opening documentary, and much of that initial underground comix scene was fomented in San Francisco.
2000s
There are plenty of movies set in SF this decade, but I didn’t see them, and the ones I did were not very good. So my choices are:
The Wild Parrots of Telegraph Hill—There may be no movie more “San Francisco” than this. A loner who lives on the Filbert Steps below Coit Tower ends up ‘adopting’ wild parrots who have moved into his neighborhood. Sweet, delightful, melancholy.
Live Nude Girls, Unite! — Another documentary that defines “only in San Francisco.” The story of the first unionized strip club. A labor doc with boobies.
2010s
The Last Black Man in San Francisco — A necessary, meditative film, created by two guys who clearly love, and fear for, San Francisco. Jarmusch undertones.
Honorable Mention
Inside Out — The only animated film on this list, it also follow Last Black Man as a critical look at San Francisco. The family’s move to the city precipitates the daughter’s emotional transformation.