If you are dealing with bark lice, which will also have webbing around the affected area, then there is some good news. Removing bark lice is not necessary, as they cause no serious harm to the tree and are actually there to feed on the leftover of other pests. You can manually pull off the web or spray soapy water on the lice to encourage themto move elsewhere. You may also use an insecticide, such as neem oil, if you are truly bothered by them.
If you mean wood lice, as in pill bugs or roly-poly bugs, then it is the moisture in the tree they are attracted to andthis article should provide some information to help get rid of them: https://www.gardeningknowhow.com/plant-problems/pests/sow-bug-control.htm