What's new in API Tester: gRPC, Socket.IO, MQTT and real test scripts
The API Tester grows from four protocols to seven — gRPC by server reflection, Socket.IO and MQTT — and replaces its old fake test evaluator with a real sandboxed JavaScript engine. Plus: collections versioned as project files, no cloud required.
Back in July we introduced the API Tester as a full REST, WebSocket, GraphQL and SSE client built into the IDE. Since then it grew a full write-up in the docs — and, more importantly, three whole new protocols, a real scripting engine, and a way to keep your API collections out of the cloud entirely.
Here's everything that's new.
gRPC, by server reflection
The API Tester now speaks gRPC without asking for a single
.proto file. Point it at host:port, tap Discover services, and it
walks the server's reflection API to list what's callable — the same
mechanism grpcurl and Postman's gRPC client use, so it works against any
server that exposes reflection.
Calls are unary only: streaming methods show up in the list, correctly
labeled and disabled, rather than being hidden or pretending to work. And the
interface never asks you to fill in a generated form field by field — you
write the request as plain JSON, PocketCode builds it into a DynamicMessage
under the hood, and you get JSON back.
Socket.IO, event by event
There's no fixed catalog of events in Socket.IO the way there is in MQTT, so the panel doesn't try to fake one. Connect to a namespace, toggle auto-reconnect if you want it, then:
- Add a listener for any event name you expect.
- Emit an event of your own with a JSON payload.
Every message in the chat-style log is tagged with the event name it belongs
to, so a connection juggling message, typing and presence events stays
readable. It's the official socket.io-client-java under the hood, so
behavior matches what you'd get from a Node client.
MQTT, topic by topic
Built on HiveMQ's client (it speaks MQTT 5, though the panel currently exposes 3.1.1-level features — no MQTT 5 properties yet, documented rather than silently dropped). Connect with or without TLS, with or without a username and password, then:
- Subscribe to a topic with QoS 0, 1 or 2.
- Publish to a topic with QoS and an optional retain flag.
Incoming messages group by topic so a device publishing to sensors/+/temp
doesn't turn into a single unreadable stream.
Test scripts that actually run
This is the one we're proudest of, because it replaces something that didn't
really work. The old test runner matched pm.test('...') calls by regular
expression and guessed the result from the words in the test's name — a
test called "user has admin role" always passed, no matter what the response
actually contained.
That's gone. Two things replace it:
- No-code assertions — pick a field (status code, response time, a header, a JSONPath into the body, body size), an operator (equals, contains, greater/less than, exists), and a value. No script, always evaluated, and fast to build on a phone keyboard.
- Real JavaScript test scripts, running in an isolated sandbox process
(
androidx.javascriptengine— zero bytes added to the APK, since it rides on the device's WebView engine). A script that throws can't take the app down with it. On the rare device with no modern WebView, it degrades to a plain console warning instead of silently pretending your tests passed.
Both write their results to the same Tests tab, and everything a script logs shows up in a dedicated Console tab — LOG / INFO / WARN / ERROR levels included.
Collections that live in your repo, not in someone else's cloud
This is the feature we think no other mobile API client has: Save to
project mirrors a collection as one readable JSON file per request, under
.pocketcode/api/<collection>/, inside the same project your code editor
already has open.
Room — PocketCode's local database — stays the source of truth day to day. Exporting regenerates the whole directory from Room, so it's always a clean snapshot. Importing shows you a preview first — a brand-new collection, or exactly how many requests would be replaced — and nothing touches the database until you confirm. Commit the files with the app's own Git manager and your API collection reviews like any other pull request, because it is one.
A few smaller things that add up
- History gained "Compare with…", a real diff between two responses — line-by-line on the body, plus a separate header diff — and "Use as mock", which turns any past response into a mock route in one tap.
- The Runner can now iterate a CSV or JSON data file, one row per iteration, with each row available to variable resolution above Collection scope.
- Dynamic variables landed:
{{$guid}},{{$timestamp}},{{$isoTimestamp}},{{$randomInt}},{{$randomEmail}},{{$randomFirstName}},{{$randomLastName}}— the same shorthand you'd expect from Postman, resolved fresh on every use. - The Mock Server can now generate routes straight from an imported OpenAPI document, and record any History response as a mock fixture.
Seven protocols, real scripts instead of a guess, and API collections that version like the rest of your code — all still running entirely on your phone, with nothing required in the cloud. If you haven't seen the rest of the module, the full breakdown is in the docs.
PocketCode is heading to Google Play. Join the pre-registration to be among the first to try it on your own device.
API Tester