About two years ago I printed for myself a phone holder for my bicycle. Apart form the plastic parts, it uses two short aluminium rods, two springs, and some common bolts&nuts.
It still looks as good as new after 1500+ km of bad quality/dirt/gravel/cobblestone roads with phone mounted + several times this distance without the phone (commuting, short trips etc.).
I consider it safe now, but use at your own risk. (When testing for durability, I strapped the phone securely with a elastic band, tied the other end of the band to the handlebar, and only then I rampaged on a cobblestone road ;-) )
The bottom "claws" that grip the phone are fixed. The top "claws" slide on the rods and are forced down by the springs. To mount the phone you just slide up the top "claws" with your phone. The force of the grip is adjusted by the position of the part that blocks the spring.
The holder is designed for a reasonable-sized phone – alcatel pixi 4(4) – that has dimensions of 121.3×64.4×9.7mm.
The scad files are tunable, so you can set any phone dimensions. But beware: most smartphones are now abhorrently oversized, and wider phone = wider "claws" that grip the phone = more stress to the plastic.
The design uses a fixed 22.2mm handlebar diameter (I guess this diameter is a standard).
Apart from the printed parts, the holder requires:
See pictures for assembly.
To print the model: after loading the stl in slicer, select split to objects/parts. Then rotate the parts for best durability. Consult the screenshot for my choices. Then arrange for your convenience.
I used PET-G, 0.2mm layer height and 0.5mm nozzle.
If you have time, consider redesigning the holder so that the balance point is exactly over the handlebar. Now it's slightly forward, and so the holder slowly tilts forward on rougher roads. To prevent this I put a flat piece of inner tube between the mount and handlebar, what fixes the problem.
Warning: do not print this with PLA, ABS or any other material that is not resistant to UV.
______________________________________________
Edit: I added stl + design files for Cubot Pocket bracket. Its shape is so far from a rectangular cuboid that I had to make a separate part for it…
The author marked this model as their own original creation.