Write File
Write content to a file. Currently only lightweight text content is supported; binary data is not supported.
Interface Description
Interface Type
writeSandboxFileParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
deviceId | string | ✅ | Device ID |
file | string | ✅ | Absolute file path (filePath) |
content | string | ✅ | Content to write (UTF-8 text) |
Return Value
Returns on success:
javascript
trueBasic Usage
javascript
const _device = await apiInvoke('getDeviceInfo', {
deviceId: 'P72578581E07'
})
const _result = await apiInvoke('writeSandboxFile', {
deviceId: 'P72578581E07',
file: `${_device.info.sandboxPath}/hello.txt`,
content: 'hello sandbox'
})
console.log(_result)