Let's suppose the debug server is basically an HTTP server which runs on your device. It means that we can send almost any data between our dev machine and Status running on a device. In this case by "sending data" we of course mean "executing HTTP requests".
The only problem here is to detect a device itself (or, technically speaking, we need an IP of this HTTP server).
We can easily get the IP of the device on the device itself. This is how it works in AirDroid (old screenshot, but the idea is still the same): https://cdn.slidehunter.com/wp-content/uploads/Connect-AirDroid.png
As you may notice here, the device itself tells us its IP address.
Summary:
- Easy;
- No discovery means that there is no need in
status-dev-cli
— our application is becoming a web server and we can usecurl
orhttpie
or anything else to send requests to it; - Requires some UI: we need to display the IP somewhere in the app;
- Maybe not that convenient as other options.
For Android:
- We can use adb shell to get the information about the connected device. The list of options can be found here: http://rapidprogrammer.com/how-to-get-android-ip-address-from-adb-commandline-shell
For iOS:
- for iOS Simulator we can use
localhost
- this approach should work: https://stackoverflow.com/questions/22504745/how-to-get-wifi-ip-of-connected-ios-device-from-the-shell However, it didn't work when I tried it.
Summary:
- It requires
adb
and/orXcode
to be installed which is not always the case for DApp developers; - Developer mode should be enabled on your device;
- However, it's quite reliable and doesn't require any additional tools (but you can say that XCode itself is an additional tool).
We can use multicast DNS service discovery. Described here: https://github.com/agnat/node_mdns
The idea is quite simple — you can announce yourself in the network, and clients can search for you.
Summary:
- Works and finds network services!
- Can work even if device is not debuggable and if developer mode is not enabled;
- Requires
libavahi-compat-libdnssd-dev
or Apple's mDNSResponder.