> For the complete documentation index, see [llms.txt](https://docs.orchard.airoverflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orchard.airoverflow.com/guides/files-and-apps.md).

# Files & apps

## Files

{% tabs %}
{% tab title="Python" %}

```python
sb.files.list("/sdcard")                        # directory listing
sb.files.upload("./local.txt", "/data/local/tmp")
n = sb.files.download("/sdcard/Download/x.pdf", "./x.pdf")  # bytes written
```

{% endtab %}

{% tab title="TypeScript" %}

```ts
await sb.files.list("/sdcard");
import { readFile } from "node:fs/promises";
await sb.files.upload(new File([await readFile("./local.txt")], "local.txt"), "/data/local/tmp");
const bytes = await sb.files.download("/sdcard/Download/x.pdf");  // Uint8Array
```

{% endtab %}
{% endtabs %}

Downloads use a short-lived **signed grant**: the SDK asks the control plane for a one-time URL, then fetches it directly (no credential in that second request). You don't manage any of that, `download` returns the bytes (TS) or writes the file and returns the byte count (Python).

## Apps

`install` takes one package, or several parts of a split-APK set. `.ipa` files install the same way on iOS sandboxes.

{% tabs %}
{% tab title="Python" %}

```python
sb.apps.list()
sb.apps.install("base.apk", "split_config.x86_64.apk")   # split set
sb.apps.launch("com.example.app")
sb.apps.download("com.example.app", "./example.apks")    # pull installed APK(s)
sb.apps.uninstall("com.example.app")
```

{% endtab %}

{% tab title="TypeScript" %}

```ts
await sb.apps.list();
await sb.apps.install(baseApkFile, splitApkFile);
await sb.apps.launch("com.example.app");
const apks = await sb.apps.download("com.example.app");   // Uint8Array
await sb.apps.uninstall("com.example.app");
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.orchard.airoverflow.com/guides/files-and-apps.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
