Understanding how to test and qualify systems of a satellite prototype is certainly on-topic in Space Exploration Stackexchange. Cubesat development is always conceptual at first, and you definitely need to use some physics to develop your understanding. That doesn't mean the question should be moved to Physics Stackexchange.
Measure in the plane perpendicular to the $\mathbb{m}$ direction and centered on the center of the device so that the $\mathbf{m \cdot r} $ term is zero. Then point the sensing direction of the magnetometer parallel to the $ \mathbb{m}$ direction. Now you have a scalar equation:
$$B = \mu H = \frac{4\pi \times 10^{-7}}{4\pi} \frac{m}{r^3} $$
$$B = \mu H = 10^{-7} \frac{m}{r^3} $$
$$m = 10^{7} B r^3 $$
So move the magnetometer close enough so that you are getting a good signal, then plug in the distance as $r$ and the measured $B$ and you have an approximate measurement of $m$.
A second way to do this is to drive your magnetotorquer with a low frequency sine wave and use a second small "sense coil" to measure the EMF at a distance. This can often be more accurate than a magnetometer, but it is tricky to do correctly.
Also remember that the magnetotorquer has a permeable material - the core that the coil is wrapped around that is long and skinny) and that's not necessarily going to be linear, so you should make a series of measurements at different currents. You should also make sure that $r$ is somewhat larger than the length of the rod, or measure at a few different distances. The magnetotorquer is not at all a perfect point dipole.
Also make sure there are no other ferromagnetic materials nearby.
In order to deal with the Earth's magnetic field, you can just turn the current on and off and look at the change in B.
The problem is at low fields, low cost magnetometers are not very accurate, so if you want to use an "Arduino class chip" (hobby type) or one in your phone, you may get results that are a bit off. But it could be a good sanity check or starting point at least.
This is actually not an easy measurement to do correctly. But you can get experiment with it even using an "unofficial magnetotorquer" to get a feeling for the process.