Skip to content

Commit 491c778

Browse files
authored
Merge pull request #229 from IGPenguin/feature/compatiblity-fixes
Fix compatibility: arecord, iscreenshot + add apowerbutton
2 parents 0705047 + 8f24a4a commit 491c778

File tree

6 files changed

+45
-6
lines changed

6 files changed

+45
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*DS_Store
22
ios/go-ios
3+
ios/nohup.out
4+
ios/selfidentity.plist

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- [🎹 acontrol](#section-id-100)
4242
- [📷 acamera](#section-id-104)
4343
- [⚡️ awireless](#section-id-107)
44+
- [👋 apowerbutton](#section-id-108)
4445
- [Manage packages](#section-id-111)
4546
- [🚀 alaunch](#section-id-113)
4647
- [🕵️ aappinfo](#section-id-118)
@@ -206,6 +207,12 @@ _Note: This tool targets macOS for compatibility, but most interactions should w
206207
* Enable or disable wireless ADB connection
207208
* Use ADB and toolkit without having USB cable attached
208209

210+
<div id='section-id-108'/>
211+
212+
### 👋 apowerbutton
213+
* Lock/Unlock the device (send Power button key event)
214+
* Useful to unlock the device after the screen is locked automatically
215+
209216
<div id='section-id-111'/>
210217

211218
## Manage packages

android/apowerbutton

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
source "$(dirname "$0")"/../common_tools
3+
android_choose_device
4+
5+
# Reference for key events - https://gist.github.com/arjunv/2bbcca9a1a1c127749f8dcb6d36fb0bc
6+
7+
echo "👋 Sending power button key event..."
8+
# Send POWER screen key event (key 26)
9+
adb -s "$SELECTED_DEVICE" shell input keyevent POWER &>/dev/null

android/arecord

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ OUTPUT_PATH=~/Desktop/"$FILENAME".mp4
6565
if $USE_LEGACY_RECORDING; then
6666
adb -s "$SELECTED_DEVICE" shell screenrecord "$DEVICE_FILE_PATH"/output.mp4
6767
else
68-
scrcpy -s "$SELECTED_DEVICE" --verbosity=error --no-playback --audio-codec=aac --record=file.mp4 --record="$OUTPUT_PATH" &>/dev/null
68+
scrcpy -s "$SELECTED_DEVICE" --verbosity=error --no-window --audio-codec=aac --record=file.mp4 --record="$OUTPUT_PATH" &>/dev/null
6969
fi
7070

7171
# Unset the trap

changelog.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
🎉 This is a new version 1.4.0!
1+
🎉 This is a new (experimental) version 1.4.1!
22

3-
📹 arecord was updated to use scrcpy, this enables recording audio in your videos
4-
You can still use the legacy variant by adding -l flag to arecord command
3+
📹 arecord was fixed to work with latest scrcpy version
4+
If you are experiencing issues, try running "brew upgrade scrcpy"
55

6-
⭐️ Special thanks to Luís Pinho for proposing and drafting this change
7-
https://github.com/luispinho
6+
📷 iscreenshot was fixed to work with iOS 17 or newer
7+
This change is still experimental - please, report back any issues
8+
9+
👋 apowerbutton was added based on a pull request by luispinho
10+
Thanks for your contribution, mate!
11+
12+
⭐️ Special thanks to Lenka and František for proposing compatibility fixes
13+
https://github.com/vrbajiva
14+
https://github.com/franceskoooo
15+
16+
💌 Rate Mobile Toolkit and provide optional feedback using this link
17+
https://forms.gle/nfBHeMSjxEQMs1kv5

common_tools

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ check_go_ios_version(){
195195
if ! [ -x "$(command -v "go-ios")" ]; then
196196
install_go_ios
197197
else
198+
#Here it complains about the missing agent/tunnel
198199
GO_IOS_VERSION=$(go-ios --version)
199200
#echo "Version of go-ios is: $GO_IOS_VERSION"
200201
fi
@@ -237,6 +238,16 @@ prompt_xcode_launch(){
237238
ios_get_devices(){
238239
check_go_ios_version
239240
check_dependency "jq"
241+
242+
if [[ $(ps S | grep -c "go-ios tunnel") -ne 2 ]]; then
243+
echo "♻️ Launching go-ios tunnel for maximum iOS compatibility (17+)"
244+
nohup go-ios tunnel start --userspace --nojson >/dev/null 2>&1 &
245+
GO_IOS_TUNNEL_PID=$!
246+
#TODO save tunnel port and use it to avoid delays when trying various ports
247+
disown $GO_IOS_TUNNEL_PID
248+
sleep 1
249+
fi
250+
240251
IOS_USB_DEVICES=( $(go-ios list --nojson | sort -u) )
241252
}
242253

0 commit comments

Comments
 (0)