Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 17 additions & 75 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
# - validate Gradle Wrapper,
# - run 'test' and 'verifyPlugin' tasks,
# - run Qodana inspections,
# - run 'buildPlugin' task and prepare artifact for the further tests,
# - run 'runPluginVerifier' task,
# - create a draft release.
#
# Workflow is triggered on push and pull_request events.
#
# GitHub Actions reference: https://help.github.com/en/actions
#
## JBIJPPTPL

name: Build

on:
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
push:
branches: [master]
# Trigger the workflow on any pull request
pull_request:

jobs:

# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
# Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
# Build plugin and provide the artifact for the next workflow jobs
build:
name: Build
runs-on: ubuntu-latest
Expand All @@ -33,23 +14,19 @@ jobs:
changelog: ${{ steps.properties.outputs.changelog }}
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1.0.4
uses: gradle/actions/wrapper-validation@v4

# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
java-version: 17
cache: gradle

# Set environment variables
- name: Export Properties
id: properties
shell: bash
Expand All @@ -58,72 +35,41 @@ jobs:
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"

echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=changelog::$CHANGELOG"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"

./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier

# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v2.1.7
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "name=$NAME" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier
- name: Build Plugin
run: ./gradlew buildPlugin

# # Run Qodana inspections
# - name: Qodana - Code Inspection
# uses: JetBrains/qodana-action@v4.2.5

# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/build/distributions
FILENAME=`ls *.zip`
FILENAME=$(ls *.zip | head -1)
unzip "$FILENAME" -d content
echo "filename=${FILENAME%.zip}" >> $GITHUB_OUTPUT

echo "::set-output name=filename::${FILENAME:0:-4}"

# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*

# Prepare a draft release for GitHub Releases page for the manual verification
# If accepted and published, release workflow would be triggered
releaseDraft:
name: Release Draft
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4

# Remove old release drafts by using the curl request for the available releases with draft flag
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -132,15 +78,11 @@ jobs:
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}

# Create new release draft - which is not publicly visible and requires manual acceptance
- name: Create Release Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ needs.build.outputs.version }} \
--draft \
--title "v${{ needs.build.outputs.version }}" \
--notes "$(cat << 'EOM'
${{ needs.build.outputs.changelog }}
EOM
)"
--notes "${{ needs.build.outputs.changelog }}"
44 changes: 12 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,49 @@
# GitHub Actions Workflow created for handling the release process based on the draft release prepared
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.

name: Release

on:
release:
types: [prereleased, released]

jobs:

# Prepare and publish the plugin to the Marketplace repository
release:
name: Publish Plugin
runs-on: ubuntu-latest
steps:

# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
java-version: 17
cache: gradle

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d'
${{ github.event.release.body }}
EOM
)"

CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=changelog::$CHANGELOG"
# Update Unreleased section with the current release note
- name: Patch Changelog
if: ${{ steps.properties.outputs.changelog != '' }}
if: ${{ github.event.release.body != '' }}
env:
CHANGELOG: ${{ steps.properties.outputs.changelog }}
CHANGELOG: ${{ github.event.release.body }}
run: |
./gradlew patchChangelog --release-note="$CHANGELOG"
# Publish the plugin to the Marketplace

- name: Publish Plugin
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
run: ./gradlew publishPlugin

# Upload artifact as a release asset
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*

# Create pull request
- name: Create Pull Request
if: ${{ steps.properties.outputs.changelog != '' }}
if: ${{ github.event.release.body != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -78,4 +58,4 @@ jobs:
--title "Changelog update - \`$VERSION\`" \
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
--base master \
--head $BRANCH
--head $BRANCH
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
/.gradle/
/gradle.properties
/out/*
/.claude/*
/.intellijPlatform/*
/.kotlin/sessions/*
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 70 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,92 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/811387b23aae4a479f842c8a485a820a)](https://app.codacy.com/manual/WahdanZ/SpockAdb?utm_source=github.com&utm_medium=referral&utm_content=WahdanZ/SpockAdb&utm_campaign=Badge_Grade_Dashboard)
![Build](https://github.com/WahdanZ/SpockAdb/workflows/Build/badge.svg)
![JetBrains IntelliJ Plugins](https://img.shields.io/jetbrains/plugin/v/11591-spock-adb)
![JetBrains IntelliJ plugins](https://img.shields.io/jetbrains/plugin/d/11591-spock-adb)
![JetBrains IntelliJ plugins](https://img.shields.io/jetbrains/plugin/d/11591-spock-adb)

# Spock ADB

# SpockAdb
<!-- Plugin description -->
Plugin Helps you to have full control of your project and device.
Full control of your Android device directly from Android Studio — no terminal needed.

Spock ADB puts the most common ADB workflows into a single tool window: navigate to the active Activity or Fragment in your editor, manage app lifecycle, toggle developer settings, control permissions, and more — all with one click.
<!-- Plugin description end -->

---

## Features

### Navigation
| Feature | Description |
|---|---|
| **Open Current Activity** | Jump directly to the currently visible Activity in your editor |
| **Open Current Fragment** | Jump directly to the currently visible Fragment (supports nested fragments) |
| **Current App Back Stack** | View the full back stack of Activities and Fragments for the foreground app |
| **Back Stack (All Apps)** | View the system-wide Activity back stack across all running apps |

### App Lifecycle
| Feature | Description |
|---|---|
| **Restart App** | Stop and relaunch the foreground application |
| **Restart with Debugger** | Relaunch and immediately attach the debugger |
| **Test Process Death** | Kill the app process without removing it from recents (tests background restore) |
| **Force Kill** | Hard kill the application process |
| **Clear App Data** | Wipe all app data (shared prefs, databases, cache) |
| **Clear App Data & Restart** | Wipe all app data and immediately relaunch |
| **Uninstall App** | Remove the application from the device |

### Permissions
| Feature | Description |
|---|---|
| **Revoke / Grant Permission** | Toggle individual runtime permissions via a checkbox dialog |
| **Grant All** | Grant every declared runtime permission at once |
| **Revoke All** | Revoke every declared runtime permission at once |

### Developer Options
| Feature | Description |
|---|---|
| **Open Developer Options** | Launch the system Developer Options screen |
| **Don't Keep Activities** | Read current state of the "Don't Keep Activities" setting |
| **Show Taps** | Toggle the "Show Taps" developer setting |
| **Show Layout Bounds** | Toggle the "Show Layout Bounds" developer setting |
| **Window Animation Scale** | Set window animation scale (0×, 0.5×, 1×, 1.5×, 2×, 5×, 10×) |
| **Transition Animation Scale** | Set transition animation scale |
| **Animator Duration Scale** | Set animator duration scale |

### Network
| Feature | Description |
|---|---|
| **Toggle Wi-Fi** | Enable or disable Wi-Fi on the device |
| **Toggle Mobile Data** | Enable or disable mobile data on the device |

### Utilities
| Feature | Description |
|---|---|
| **Input Text** | Type text into the focused field on the device |
| **Open Deep Link** | Fire an `android.intent.action.VIEW` intent with any URI |

---

## Screenshot

## **Features**
- Navigate to current active activity in your IDE
- Current BackStack Activities
- Navigate to current active fragments
- Clear application data
- Enable and Disable Permissions of your application
- Kill or Restart Application
- Restart app with debugger
- Uninstall and Clear App Data and Restart
- Toggle "Show Taps" setting;
- Toggle "Show Layout Bounds" setting;
- Toggle "Don't Keep Activities" setting;
- Adds option to Grant or Revoke all app permissions at once.
![Screenshot](images/spock_adb.png)

- Change scale of:
- Window Animation;
- Transition Animation;
- Animator Duration.
---

## Screenshot
## Installation

![Screenshot](images/spock_adb.png)
**JetBrains Marketplace:** [Spock ADB](https://plugins.jetbrains.com/plugin/11591-spock-adb)

## Download
Or install directly in Android Studio: `Settings → Plugins → Marketplace → search "Spock ADB"`

https://plugins.jetbrains.com/plugin/11591-spock-adb
---

## Demo

[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/x_WX_Pznqos/0.jpg)](http://www.youtube.com/watch?v=x_WX_Pznqos)
[![Demo video](http://img.youtube.com/vi/x_WX_Pznqos/0.jpg)](http://www.youtube.com/watch?v=x_WX_Pznqos)

---

## License

```
Copyright 2019 Ahmed Wahdan
Expand Down
Loading
Loading