For example, dropping it off the coast of Japan, close enough for the Japanese to see its power but far enough so that casualties would be minimal. Or simply sending Japan the video footage of the Trinity test. The hope being that Japan would surrender after seeing it.
In may of 1945 the Interim Committee, created to advise the president about nuclear weapons and their usage, considered giving the Japanese advanced warning, or detonating a nuclear device somewhere on the Japanese islands that was uninhabited, to demonstrate the power of the bomb. There were a number of reasons that this idea was rejected by the committee:
The bomb might not work - The technology, while technically operational, had not matured to a level where the detonation of the bomb could be certain. If a public test was attempted and the device failed to function, it would be a complete embarrasment to the United States, and Japan wouldn't take the threat seriously.
The bombs were expensive and difficult to produce - The United States didn't have enough nuclear weapons to spare one on a test. They were being saved for both the isolated city bombings, and then for use in concert with the proposed invasion of the Japanese main islands.
Without a city to demonstrate it's destructive power against, the Japanese might think it was some sort of a trick, and not take the threat seriously.
Despite American air superiority by the end stages of the war, Japan could still have interrupted a nuclear strike with their remaining air power if they had advanced warning.
It would sacrifice the "shock value" of the weapon
In summary, it was seriously considered, but it was ultimately decided that it could potentially compromise value of using the weapon in the first place.
I have written a bit about this here — it was considered briefly by the Interim Committee and the Scientific Committee to the Interim Committee. Which is to say, it went as high as the Secretary of War (not to Truman). It was rejected for several reasons, but mainly because the goal of the Manhattan Project and the US high command was, for a lot of reasons, to use the weapon.
From what I know, they actually did. US dropped leaflets prior to atomic, but even a conventional bombing. Urging civilians to flee. Truman also did radio adress talking about "rain of ruin from the air, the like which never been seen on this Earth". Of course US never warned about specific targets being bombed for the fear of AA guns and pilots being deployed to prevent this. It's debatable whether Japan has been warned. But generally the idea that atomic bomb ended the war is not right either. I guaruantee you that the unexpected entry of Soviet Union's intothe war against Japan on Aug. 8 was a bigger shock than A-bomb. This was confirmed by the historian Tsuyoshi Hasegawa. You can find more in his book "Racing the Enemy".
So the notion that US would "demonstrate" it's power on abandoned target's doesn't even in retrospect makes much sense. It definetly didn't then. You forget that today the effects of Atom bomb are well documented and known. It's a big boogyman. Then, nobody had really any idea what it will do.