Skip to content

Commit

Permalink
add: subcommand instructions in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
itsspriyansh committed Sep 3, 2024
1 parent 1736a7c commit 2142087
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Official Nightwatch helper-tool to easily setup all the requirements needed to g
- [Mobile app testing](#mobile-app-testing---android)
- [On Android](#mobile-app-testing---android)
- [On iOS](#mobile-app-testing---ios)
- [Do more with Android SDK](#do-more-with-android-sdk)
- [Run Android SDK binaries](#run-android-sdk-binaries)

### Mobile web testing - Android

Expand Down Expand Up @@ -536,3 +538,85 @@ Official Nightwatch helper-tool to easily setup all the requirements needed to g
# test on real-device (assuming test saved as `test/wikipedia-ios.js`)
npx nightwatch test/wikipedia-ios.js --env app.ios.real
```
### Do more with Android SDK
The tool supports various Android SDK workflows, accessible through the following subcommands:
1. [connect](./docs/subcommands/connect.md)
2. [list](./docs/subcommands/list.md)
3. [install](./docs/subcommands/install.md)
4. [uninstall](./docs/subcommands/uninstall.md)
#### Syntax
The following syntax is used for executing subcommands:
```bash
npx @nightwatch/mobile-helper android <subcommand> [flags|cliConfigs]
```
#### 1. Connect a real device or launch an AVD
```sh
npx @nightwatch/mobile-helper android connect [flags]
```
| Flag | Description |
| ---------- | ------------------------------------- |
| --wireless | Connect a real device wirelessly |
#### 2. List all the connected devices and installed AVDs
```sh
npx @nightwatch/mobile-helper android list [flags]
```
| Flag | Description |
| ---------- | ------------------------------------------------------ |
| --device | Show a list of all the connected real devices and AVDs |
| --avd | Show a list of all the currently installed AVDs |
#### 3. Install an APK or create a new AVD
```sh
npx @nightwatch/mobile-helper android install [flags]
```
| Flag | Description |
| ----- | ------------------------------------------ |
| --app | Install an APK on a real device or an AVD |
| --avd | Create a new AVD |
#### 4. Uninstall an app or delete an AVD
```sh
npx @nightwatch/mobile-helper android uninstall [flags]
```
| Flag | Description |
| ----- | ---------------------------------------------- |
| --app | Uninstall an app from a real device or an AVD |
| --avd | Delete an AVD |
### Run Android SDK binaries
Easily run Android SDK binaries without needing to locate them manually by using the `mobile-helper` CLI.
**Syntax**
```sh
npx @nightwatch/mobile-helper android.<binary_name> [args]
```
**Currenty supported binaries:**
- adb
- avdmanager
- sdkmanager
- emulator
Check the [docs](./docs/) to know more about using the above binaries.

0 comments on commit 2142087

Please sign in to comment.