mirror of
https://github.com/appium/appium.git
synced 2026-10-25 02:00:57 +08:00
docs: Added Ruby and Python for audio capture, add mobile command (#14321)
* docs: Added Ruby and Python for audio capture, add mobile command * fix ruby * fix sleep in python
This commit is contained in:
@@ -63,6 +63,8 @@
|
||||
| mobile:getAppearance | Get the device's UI appearance style via `xcrun simctl ui`. It returns `light`, `dark`, `unknown` or `unsupported` (below iOS 12). |||
|
||||
| mobile:setAppearance | Set the device's UI appearance style via `xcrun simctl ui` or Siri command. | `{style}` | `{style: 'dark'}` |
|
||||
| mobile:getDeviceTime | Get time of the device under test. https://momentjs.com/docs/ is the full list of supported datetime format specifiers. Defaults to `YYYY-MM-DDTHH:mm:ssZ` which is ISO-8601. | `{format}` | `{format: 'YYYY-MM'}` |
|
||||
| mobile:startAudioRecording | Start recording audio stream. Read [Audio Capture From iOS Simulators and Real Devices](/docs/en/writing-running-appium/ios/audio-capture.md) for more details | | |
|
||||
| mobile:stopAudioRecording | Stop and store the recording audio stream. Read [Audio Capture From iOS Simulators and Real Devices](/docs/en/writing-running-appium/ios/audio-capture.md) for more details | | |
|
||||
|
||||
### Android
|
||||
| Command | Description | Argument | Argument Example |
|
||||
|
||||
@@ -42,6 +42,22 @@ try (FileOutputStream fos = new FileOutputStream("out.mp4")) {
|
||||
}
|
||||
```
|
||||
|
||||
```ruby
|
||||
# Ruby
|
||||
@driver.execute_script 'mobile: startAudioRecording', audioInput: ':0'
|
||||
sleep 10
|
||||
base64_str = @driver.execute_script 'mobile: stopAudioRecording'
|
||||
File.write 'out.mp4', Base64.decode64(base64_str)
|
||||
```
|
||||
|
||||
```python
|
||||
# Python
|
||||
driver.execute_script('mobile: startAudioRecording', {'audioInput': ':1'})
|
||||
time.sleep(10)
|
||||
base64_str = driver.execute_script('mobile: stopAudioRecording')
|
||||
with open('out.mp4', 'wb') as f:
|
||||
f.write(base64.b64decode(base64_str))
|
||||
```
|
||||
|
||||
### Server Requirements
|
||||
|
||||
|
||||
Reference in New Issue
Block a user