About Android-Utils

Description
ModuleBase
Version
Author
CompanyName
Copyright
PowerShell module providing utility commands to manipulate a APK file on Windows.
D:\a\powershell-android-utils\powershell-android-utils\docs\modules\Android-Utils
1.0
Dominique Righetto
Personal
GNU GPL v3

Backup-Data-APK

Synopsis

Syntax

Backup-Data-APK -appPkg <String> -encryptionPassword <SecureString>

Description

Perform a backup of the provided package name on the current connected device using the current connected ADB instance.

Parameters

-appPkg
<String>
Package name of the application.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

-encryptionPassword
<SecureString>
Encryption password specified into the backup interface on the device during the backup process. Do not specify it on the command line but using the prompt, see call example.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
2

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Backup-Data-APK -appPkg my.app.package






https://github.com/nelenkov/android-backup-extractor

Notes


Compress-APK

Synopsis

Syntax

Compress-APK

Description

Repack and sign an APK using APKTOOL + ZIPALIGN + APKSIGNER instances present in PATH environment variable.

Parameters

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Compress-APK






Notes


Connect-Android-Device

Synopsis

Syntax

Connect-Android-Device -deviceHost <String>

Description

Establish the connection between ADB and a Android device on port 5555.

Parameters

-deviceHost
<String>
IP address or host name of the device to connect to.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Connect-Android-Device -deviceHost 10.10.10.10






https://developer.android.com/tools/adb

Notes


Expand-APK

Synopsis

Syntax

Expand-APK -apkLocation <String>

Description

Depack an APK using APKTOOL instance present in PATH environment variable.

Parameters

-apkLocation
<String>
Path to the APK to depack.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Expand-APK -apkLocation app.apk






Notes


Find-Framework

Synopsis

Syntax

Find-Framework -apkLocation <String>

Description

Try to find if the APK use a framwework used to generate native app.

Parameters

-apkLocation
<String>
Path to the APK to analyze.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Find-Framework -apkLocation app.apk






https://medium.com/javarevisited/top-5-frameworks-to-create-cross-platform-android-and-ios-apps-in-2020-d02edf3d01f1

Notes


Get-APK

Synopsis

Syntax

Get-APK -appPkg <String>

Description

Get the APK from the provided package name on the current connected device using the current connected ADB instance.

Parameters

-appPkg
<String>
Package name of the application.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Get-APK -appPkg my.app.package






Notes


Get-APK-Flags

Synopsis

Syntax

Get-APK-Flags -appPkg <String>

Description

Get the list of app flags.

Parameters

-appPkg
<String>
Package name of the application.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Get-APK-Flags -appPkg my.app.package






https://developer.android.com/studio/command-line/dumpsys

Notes


Get-APK-Permissions

Synopsis

Syntax

Get-APK-Permissions -appPkg <String>

Description

Get the list of app permissions .

Parameters

-appPkg
<String>
Package name of the application.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Get-APK-Permissions -appPkg my.app.package






https://developer.android.com/studio/command-line/dumpsys

Notes


Get-Memory-Dump

Synopsis

Syntax

Get-Memory-Dump -appPkg <String>

Description

Take a memory dump of the process of the application specified on the current connected device using the current connected ADB instance and download it into the current folder (dump file is removed after the download).

Parameters

-appPkg
<String>
Package name of the application.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Get-Memory-Dump -appPkg my.app.package






https://developer.android.com/studio/profile/memory-profiler

Notes


Get-Packages

Synopsis

Syntax

Get-Packages

Description

List installed packages on the current connected device using the current connected ADB instance.

Parameters

Inputs

Outputs

Examples

Example 1
Get-Packages






Notes


Get-Screenrecord

Synopsis

Syntax

Get-Screenrecord

Description

Take a screen recording on the current connected device using the current connected ADB instance and download it into the current folder (video is removed after the download).

Parameters

Inputs

Outputs

Examples

Example 1
Get-Screenrecord






Notes


Get-Screenshot

Synopsis

Syntax

Get-Screenshot

Description

Take a screenshot on the current connected device using the current connected ADB instance and download it into the current folder (image is removed after the download).

Parameters

Inputs

Outputs

Examples

Example 1
Get-Screenshot






Notes


Install-APK

Synopsis

Syntax

Install-APK

Description

Re-Install patched application (replace app with the same package name) using the current connected ADB instance.

Parameters

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Install-APK






Notes


Show-Android-Functions

Synopsis

Syntax

Show-Android-Functions

Description

Show the available functions exposed by the "Android-Utils" module.

Parameters

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Show-Android-Functions






https://github.com/righettod/powershell-android-utils

Notes


Show-Device-Screen

Synopsis

Syntax

Show-Device-Screen

Description

Cast the current USB connected device screen to the current computer using SCRCPY tool from Genymobile.

Parameters

Inputs

Outputs

Examples

Example 1
Show-Device-Screen






https://github.com/Genymobile/scrcpy

Notes


Show-Diff-APK

Synopsis

Syntax

Show-Diff-APK -apkFirstLocation <String> -apkSecondLocation <String>

Description

Show the difference between 2 APK files.

Parameters

-apkFirstLocation
<String>
Path to the first APK file.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

-apkSecondLocation
<String>
Path to the second APK file.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
2

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Show-Diff-APK -apkFirstLocation .\app1.apk -apkSecondLocation .\app2.apk






https://github.com/JakeWharton/diffuse

Notes


Show-Signature-APK

Synopsis

Syntax

Show-Signature-APK -apkLocation <String>

Description

Show the APK signature using APKSIGNER instance present in PATH environment variable.

Parameters

-apkLocation
<String>
Path to the APK for which the signature must be displayed.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
true
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Show-Signature-AP -apkLocation app.apk






https://source.android.com/security/apksigning

Notes


Test-Tools

Synopsis

Syntax

Test-Tools

Description

Check availability of used Android tools.

Parameters

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Test-Tools






Notes


Watch-Device-Broadcasts

Synopsis

Syntax

Watch-Device-Broadcasts [-marker <String>]

Description

Monitor the broadcasts send by the device .

Parameters

-marker
<String>
String used to filter the events.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
false
1

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Watch-Broadcasts-Events






Example 2
Watch-Broadcasts-Events -marker "myapp"






https://developer.android.com/studio/command-line/dumpsys

Notes


Watch-Log

Synopsis

Syntax

Watch-Log [-marker <String>] [-tag <String>] [-priority <String>]

Description

Show the device log applying the provided filter on current connected device using the current connected ADB instance.

Parameters

-marker
<String>
Filtering expression used as regex.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
false
1

false
false

-tag
<String>
Filtering expression used as Android logging TAG.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
false
2

false
false

-priority
<String>
Filtering log priority ordered from lowest to highest priority (single character in the following range): (V)erbose / (D)ebug / (I)nfo / (W)arning / (E)rror / (F)atal / (S)ilent.

Required?
Position?
Default value
Accept pipeline input?
Accept wildchard characters?
false
3

false
false

Inputs

None. You cannot pipe objects to this function.

Outputs

Examples

Example 1
Watch-Log -marker "Wifi"






Example 2
Watch-Log -marker "^(.*(Patched).*)$"






Example 3
Watch-Log -tag "APP_TAG"






Example 4
Watch-Log -tag "APP_TAG" -priority I






Example 5
Watch-Log -priority I






https://developer.android.com/studio/command-line/logcat#filteringOutput

Notes