tryorchard-sdk
Python client for Orchard: create and drive iOS and Android sandboxes, manage snapshots, templates, teams and scoped API keys, and stream live channels (logs, shell, screen, adb, VNC, mitm, frida).
pip install tryorchard-sdk
Requires Python 3.10+. The import name is orchard_sdk.
Quickstart
from orchard_sdk import Orchard
orchard = Orchard.from_env() # ORCHARD_API_URL + ORCHARD_API_KEY
# or: Orchard("https://orchard.example.com", "orc_live_xxx")
for s in orchard.sandboxes.list()["instances"]:
print(s["name"], s["state"])
sb = orchard.sandbox("my-pixel") # uuid, uuid prefix, name or tag
sb.start()
sb.apps.install("./build/app.apk")
sb.launch("com.example.app")
sb.tap_text("Sign in")
with open("screen.png", "wb") as f:
f.write(sb.screenshot())
with sb.logs() as stream:
for line in stream:
print(line)
Configuration
| Variable | Purpose |
|---|---|
ORCHARD_API_URL |
Control-plane URL, e.g. https://orchard.example.com |
ORCHARD_API_KEY |
API key (orc_…) or JWT access token |
ORCHARD_ORG |
Optional org slug (ignored for API keys) |
ORCHARD_WS |
Optional workspace slug |
Explicit arguments to Orchard(...) win over the environment. The client holds a connection pool: use it as a context manager or call close().
Live channels
Channels are context-managed iterators that work in ordinary synchronous code:
with sb.shell() as sh:
sh.send("getprop ro.build.version.release\n")
for out in sh:
print(out, end="")
For asyncio code use orchard_sdk.aio.AsyncChannels:
import asyncio
from orchard_sdk import from_env
from orchard_sdk.aio import AsyncChannels
async def main():
async for line in AsyncChannels(from_env(), sb.uuid).logs():
print(line)
asyncio.run(main())
Expose a device channel on a local port for ordinary tools:
with sb.adb_bridge() as bridge:
print(f"adb connect 127.0.0.1:{bridge.port}")
Errors
All errors derive from OrchardError: ApiError (HTTP status + server detail), SelectorError (zero or ambiguous sandbox match), ChannelClosedError (WebSocket closed with 4401/4403/4404/4502).
from orchard_sdk import ApiError, SelectorError
try:
orchard.sandbox("pixel").start()
except SelectorError as e:
print(e)
except ApiError as e:
print(e.status, e.detail)
Documentation
- API reference: every method, with examples
- Examples: install and launch, UI test with snapshot rollback, frida tracing, traffic capture, adb bridge, scoped keys, log streaming
License
MIT
Metadata
Release files for tryorchard-sdk 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tryorchard_sdk-0.0.1.tar.gz | 28.0 kB | Without provenance | Details for tryorchard_sdk-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tryorchard_sdk-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for tryorchard_sdk-0.0.1-py3-none-any.whl |
Total release size: 57.9 kB
Release files / tryorchard_sdk-0.0.1.tar.gz
| Download URL | tryorchard_sdk-0.0.1.tar.gz |
|---|---|
| Size | 28.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfdea8fa97103cc6c5f2daecf2cf50325cfbefc4216196bfacb5d20c97c5cd23
|
|
BLAKE2b-256 checksum How to use checksums |
9a71778604dcdff0b6e6097fd30ad054eeb38ca7bc848fc00d490f8b0af11f1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / tryorchard_sdk-0.0.1-py3-none-any.whl
| Download URL | tryorchard_sdk-0.0.1-py3-none-any.whl |
|---|---|
| Size | 29.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28013013b3a77666d0327aae34cef63d6176c4b575b7b850b722f6d2d1d63f78
|
|
BLAKE2b-256 checksum How to use checksums |
6166c53262a8efa596fc12ad28737d2f0ae6b2841142f6113e0c007081875d77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for tryorchard-sdk 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.