Skip to content

Commit e302593

Browse files
committed
Added apk installer bundle
1 parent f9a9995 commit e302593

17 files changed

Lines changed: 20936 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
powershell.exe -nologo -ExecutionPolicy Bypass -File src\installer_script.ps1
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
Clear-Host
2+
3+
Write-Host ""
4+
Write-Host "Instructions:`n"
5+
Get-Content -Path "src\instructions.txt"
6+
Write-Host ""
7+
8+
$paired = $false
9+
$connected = $false
10+
11+
$response = Read-Host "Is the device already paired? (Y/N)"
12+
$response = $response.ToLower()
13+
if ($response -ne 'y') {
14+
# Pair device
15+
$host_ip = Read-Host "Device IP address"
16+
$pairing_port = Read-Host "Wireless pairing port"
17+
$pairing_code = Read-Host "Pairing code"
18+
19+
Write-Host "Pairing device..."
20+
$pairOutput = & .\tools\adb pair "$host_ip`:$pairing_port" $pairing_code 2>&1
21+
if ($pairOutput -imatch "Successfully paired") {
22+
Write-Host ""
23+
Write-Host "Pairing successful."
24+
Write-Host ""
25+
$paired = $true
26+
} else {
27+
Write-Host ""
28+
Write-Host "Pairing failed - please check the IP, port, and pairing code."
29+
Write-Host ""
30+
Pause
31+
exit
32+
}
33+
} else {
34+
$host_ip = Read-Host "Device host address"
35+
}
36+
37+
# Connect to device
38+
$debug_port = Read-Host "Wireless debugging port"
39+
$s = "$host_ip`:$debug_port"
40+
41+
Write-Host "Connecting to device..."
42+
$connectOutput = & .\tools\adb connect $s 2>&1
43+
if ($connectOutput -imatch "connected to") {
44+
Write-Host ""
45+
Write-Host "Connected successfully."
46+
Write-Host ""
47+
$connected = $true
48+
} else {
49+
Write-Host ""
50+
Write-Host "Failed to connect to the device at $s"
51+
Write-Host "Please check the IP, port, and whether the device is online and authorized."
52+
Write-Host ""
53+
Pause
54+
exit
55+
}
56+
57+
# Install APK
58+
Write-Host "`Installing the app..."
59+
$installOutput = & .\tools\adb -s $s install -r "apk\ims.apk" 2>&1
60+
$installSucceeded = $false
61+
$updateIncompatible = $false
62+
63+
foreach ($line in $installOutput) {
64+
if ($line -imatch "Success") {
65+
$installSucceeded = $true
66+
}
67+
if ($line -imatch "INSTALL_FAILED_UPDATE_INCOMPATIBLE") {
68+
$updateIncompatible = $true
69+
}
70+
}
71+
72+
if (-not $installSucceeded) {
73+
if ($updateIncompatible) {
74+
& .\tools\adb -s $s uninstall com.imsproject.watch | Out-Null
75+
$reinstallOutput = & .\tools\adb -s $s install "apk\ims.apk" 2>&1
76+
77+
$installSucceeded = $reinstallOutput -imatch "Success"
78+
if (-not $installSucceeded) {
79+
Write-Host "App install failed. Output:"
80+
$reinstallOutput | ForEach-Object { Write-Host $_ }
81+
Pause
82+
exit
83+
}
84+
} else {
85+
Write-Host "App install failed. Output:"
86+
$installOutput | ForEach-Object { Write-Host $_ }
87+
Pause
88+
exit
89+
}
90+
}
91+
92+
Write-Host "`nApp installed successfully."
93+
Write-Host ""
94+
Pause
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
------------------------
2+
3+
[before you start]
4+
In the developer options menu:
5+
1) Enable 'ADB Debugging'
6+
2) Enable 'Wireless debugging'
7+
8+
If your device is already paired, you can skip the pairing step.
9+
10+
[pairing step]
11+
In the wireless debugging menu, click on pair new device
12+
It will say "Pair with device" at the top and you will see
13+
an IP address that is something like xyz.xyz.xyz.xyz:ddddd
14+
15+
> 'xyz.xyz.xyz.xyz' is the device host address
16+
> 'ddddd' is the pairing port
17+
18+
after inserting the required information and pairing successfully
19+
you are required to find the debug port.
20+
21+
[connection step]
22+
In the wireless debugging menu it will show you an ip address
23+
with a port **different** to the one you used to pair - that is the debug port
24+
25+
If the device is already paired you will be prompted to insert the host address too.
26+
27+
after entering the required information, the apk should install successfully
28+
29+
------------------------
106 KB
Binary file not shown.
71.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)