Automated testing of mobile SDKs?

I was wondering if anyone here has experience with test automation for mobile SDKs. Ones that you incorporate into mobile apps to actually do stuff with it. This is with respect to SDKs that have no UI component, and where you are testing the app to SDK communication/integration and local functionality of the SDK/app/device, and not directly/specifically the SDK to cloud/web communication/integration. Some functionality which might encompass device specific data/features like bluetooth, sensors/accelerometer/gyroscope/compass

From perspective of automated testing of it, what are the ways to go about it?

  • (enhanced or just) unit tests of the SDK?
  • build a dummy test app that includes the SDK, then exercise the SDK through the dummy app

For the dummy app case, how best to exercise the SDK from automation standpoint?

  • build GUI workflow in dummy app to test the SDK functionality (making the dummy app quite like an actual UI-based app)? Test the app via the GUI
  • expose a REST API web server or equivalent (idea) to interface to the SDK (i.e. expose SDK functionality via REST APIs, as the SDK’s normal functionality is exposed as Android/iOS library function calls). Test the app by calling the APIs and validating the responses. API server would be started when the dummy app starts, etc. and accessible over localhost or some other IP/hostname & port.

Launching the dummy app for test may be with Appium, UI Automator, and native Android/iOS test tooling.

Any other ideas I may have overlooked?