Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appium-interceptor

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appium-interceptor

Appium 2.0 plugin to mock api calls for android apps

  • 1.0.0-beta.12
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

appium-interceptor-plugin

This is an Appium plugin designed to intercept API response and mocking easy. This plugin uses mitmproxy

Prerequisite

  1. Appium version 2.0
  2. Intercepting API requests from android requires CA certificate to be installed on the device. Follow the instructions in How to install CA certificate on android section and install the CA certificate.

Installation - Server

Install the plugin using Appium's plugin CLI, either as a named plugin or via NPM:

appium plugin install --source=npm appium-interceptor

Activation

The plugin will not be active unless turned on when invoking the Appium server:

appium server -ka 800 --use-plugins=appium-interceptor -pa /wd/hub

what does this plugin do?

For every appium session, interceptor plugin will start a proxy server and updates the device proxy settings to pass all network traffic to proxy server. Mocking is disabled by default and can be enabled from the test by passing appium:intercept : true in the desired capability while creating a new appium session.

Please refer to the commands sections for detailed usage.

Supported Platforms

💚 Android

Mocking support

  1. Update outgoing request URL
  2. Fully Replace or partially modify the request payload (POST Body)
  3. Update the request headers
  4. Update the response headers
  5. Fully Replace or partially modify the response body
  6. Update the response status code.

Usage

Refer Examples here

Troubleshooting

In certain instances where the session terminates abruptly, the device proxy state may persist without being cleared, leading to a non-functional network connection. To rectify this issue and reset the device proxy state, execute the following adb command.

adb shell settings put global http_proxy :0

Build local

npm install

npm run build

Credits

A special thanks to creators and maintainers of node-http-mitm-proxy. Their efforts have laid the foundation for the capabilities embedded in this plugin.

FAQs

Package last updated on 07 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc