Chemical analysis of soil can only be done by a laboratory. Most cooperative extension services (county agent offices) offer soil tests for a small fee. The test will provide data on pH measurements and composition of minerals. Some even include tests for microorganisms.
Do-it-yourself kits are available. They have varying degrees of accuracy.
To collect a sample for testing, do the following:
The final report will then be mailed to you.
Related article: Soil in A Desert Garden.
See also USDA Cooperative Extension Service for the office nearest you.