From 5a4a1288ca4ba34682f2989335a6bd61dbc3c67e Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Thu, 22 Oct 2020 14:05:25 +0200 Subject: [PATCH 01/24] implement CLI recoding --- ios/irecord | 70 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 12 deletions(-) diff --git a/ios/irecord b/ios/irecord index cb19ccfb..9b204f77 100755 --- a/ios/irecord +++ b/ios/irecord @@ -1,14 +1,60 @@ #!/bin/bash -echo "📹 Opening QuickTime..." - -osascript <> "$IOS_DEVICES_LIST" + egrep -v "Found|FaceTime" "$IOS_DEVICES_LIST" > "$IOS_DEVICES_LIST.tmp" #remove info line and webcam + mv "$IOS_DEVICES_LIST.tmp" "$IOS_DEVICES_LIST" + sed 's/^* //g' "$IOS_DEVICES_LIST" > "$IOS_DEVICES_LIST.tmp" #remove "* " line prefixes + mv "$IOS_DEVICES_LIST.tmp" "$IOS_DEVICES_LIST" + + if [ "$(nl "$IOS_DEVICES_LIST")" == "" ]; then + echo "❌ iOS device not deteceted, reconnect it and try again" + exit 1 + fi + + if [ "$(wc -l "$IOS_DEVICES_LIST" | awk '{print $1}')" == "1" ]; then + DEVICE_NAME="$(cat "$IOS_DEVICES_LIST")" + else + echo "📱 Available:" + nl "$IOS_DEVICES_LIST" + read -r -p "📝 Choose: " DEVICE_INDEX + + DEVICE_NAME=$(sed "$DEVICE_INDEX"!d "$IOS_DEVICES_LIST") + if [[ $DEVICE_INDEX == "" || $DEVICE_NAME == "" ]]; then + delete_lastline + pick_recording_device + fi + fi +} + +start_recording(){ + FILENAME="$DEVICE_NAME-$(date +%Y-%m-%d-%H-%M-%S).mp4" + echo "📹 Recording screen on $DEVICE_NAME, stop it with ctrl^c" + videosnap -p High -d "$DEVICE_NAME" "$FILENAME" &> /dev/null +} + +start_quicktime +pick_recording_device +start_recording From 9bb7d02890918b957489fb70b618c08fffc1820d Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Thu, 22 Oct 2020 14:10:19 +0200 Subject: [PATCH 02/24] =?UTF-8?q?check=20dependency=20&=C2=A0disable=20del?= =?UTF-8?q?ay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/irecord | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ios/irecord b/ios/irecord index 9b204f77..f37af422 100755 --- a/ios/irecord +++ b/ios/irecord @@ -10,6 +10,14 @@ ctrlc(){ exit } +check_videosnap_dependency(){ #TODO refactor when videosnap available via Homberew + if ! [ -x "$(command -v "videosnap")" ]; then + echo "💥 \"videosnap\" command required!" + should_proceed "🛒 Install via GitHub?" + open "https://github.com/matthutchinson/videosnap/releases" + fi +} + start_quicktime(){ echo "📹 Opening QuickTime in background to enable recording..." osascript < /dev/null + videosnap -w 0 -p High -d "$DEVICE_NAME" "$FILENAME" &> /dev/null } +check_videosnap_dependency start_quicktime pick_recording_device start_recording From ab929ca6f99b3fdb38a0e536a2419177c930c2cc Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Thu, 22 Oct 2020 14:17:32 +0200 Subject: [PATCH 03/24] improve output --- ios/irecord | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ios/irecord b/ios/irecord index f37af422..fad1e5ac 100755 --- a/ios/irecord +++ b/ios/irecord @@ -2,12 +2,16 @@ LOCATION=$(dirname "$0") IOS_DEVICES_LIST=$LOCATION/../data/toolkit_recordable_ios_devices.txt trap 'ctrlc $@' 1 2 3 6 15 + +RECORDING=false cd ~/Desktop || exit ctrlc(){ - echo "✅ Saved into ~/Desktop/$FILENAME" - osascript -e 'quit app "QuickTime Player"' - exit + if $RECORDING ; then + echo "✅ Saved into ~/Desktop/$FILENAME" + fi + osascript -e 'quit app "QuickTime Player"' + exit } check_videosnap_dependency(){ #TODO refactor when videosnap available via Homberew @@ -19,7 +23,7 @@ check_videosnap_dependency(){ #TODO refactor when videosnap available via Homber } start_quicktime(){ - echo "📹 Opening QuickTime in background to enable recording..." + echo "💡 Opening QuickTime to enable recording (webcam light might turn on)..." osascript < /dev/null From 822ed684ce9aac567f7fc927fdd2805b713fd5d7 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Thu, 22 Oct 2020 14:24:51 +0200 Subject: [PATCH 04/24] use grep instead of egrep --- ios/irecord | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/irecord b/ios/irecord index fad1e5ac..4895fe90 100755 --- a/ios/irecord +++ b/ios/irecord @@ -36,7 +36,7 @@ pick_recording_device(){ echo "⏳ Detecting iOS devices..." rm -f "$IOS_DEVICES_LIST" videosnap -l >> "$IOS_DEVICES_LIST" - egrep -v "Found|FaceTime" "$IOS_DEVICES_LIST" > "$IOS_DEVICES_LIST.tmp" #remove info line and webcam + grep -E -v "Found|FaceTime" "$IOS_DEVICES_LIST" > "$IOS_DEVICES_LIST.tmp" #remove info line and webcam mv "$IOS_DEVICES_LIST.tmp" "$IOS_DEVICES_LIST" sed 's/^* //g' "$IOS_DEVICES_LIST" > "$IOS_DEVICES_LIST.tmp" #remove "* " line prefixes mv "$IOS_DEVICES_LIST.tmp" "$IOS_DEVICES_LIST" From 156f1a3fa7d41ea4c5927d2d6ed1f8fa12e920a5 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Thu, 22 Oct 2020 14:45:18 +0200 Subject: [PATCH 05/24] fix dependency check --- ios/irecord | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ios/irecord b/ios/irecord index 4895fe90..bc08dc75 100755 --- a/ios/irecord +++ b/ios/irecord @@ -1,5 +1,6 @@ #!/bin/bash LOCATION=$(dirname "$0") +source "$LOCATION"/../common_tools IOS_DEVICES_LIST=$LOCATION/../data/toolkit_recordable_ios_devices.txt trap 'ctrlc $@' 1 2 3 6 15 @@ -19,6 +20,7 @@ check_videosnap_dependency(){ #TODO refactor when videosnap available via Homber echo "💥 \"videosnap\" command required!" should_proceed "🛒 Install via GitHub?" open "https://github.com/matthutchinson/videosnap/releases" + exit 1 fi } From 268b730584fe61fa62b244688bf5526014f313f8 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:09:08 +0100 Subject: [PATCH 06/24] improve output, check pairing --- ios/irecord | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ios/irecord b/ios/irecord index bc08dc75..1a409ca0 100755 --- a/ios/irecord +++ b/ios/irecord @@ -18,14 +18,14 @@ ctrlc(){ check_videosnap_dependency(){ #TODO refactor when videosnap available via Homberew if ! [ -x "$(command -v "videosnap")" ]; then echo "💥 \"videosnap\" command required!" - should_proceed "🛒 Install via GitHub?" + should_proceed "🛒 Install via GitHub? (download and run \"videosnap-0.0.6.pkg\")" open "https://github.com/matthutchinson/videosnap/releases" exit 1 fi } start_quicktime(){ - echo "💡 Opening QuickTime to enable recording (webcam light might turn on)..." + echo "💡 Starting QuickTime to enable recording (webcam light might turn on)..." osascript < /dev/null } +ios_check_developer_image_and_pairing check_videosnap_dependency start_quicktime pick_recording_device From d4fef06f3e066731a76a4871802417736439c159 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:25:36 +0100 Subject: [PATCH 07/24] remove pairing check --- ios/irecord | 1 - 1 file changed, 1 deletion(-) diff --git a/ios/irecord b/ios/irecord index 1a409ca0..4910e57e 100755 --- a/ios/irecord +++ b/ios/irecord @@ -70,7 +70,6 @@ start_recording(){ videosnap -w 0 -p High -d "$DEVICE_NAME" "$FILENAME" &> /dev/null } -ios_check_developer_image_and_pairing check_videosnap_dependency start_quicktime pick_recording_device From 1fe18190166d56ecbef3541a5a1109a6a233a5de Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:27:53 +0100 Subject: [PATCH 08/24] improve output --- ios/irecord | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/irecord b/ios/irecord index 4910e57e..272354e8 100755 --- a/ios/irecord +++ b/ios/irecord @@ -44,7 +44,7 @@ pick_recording_device(){ mv "$IOS_DEVICES_LIST.tmp" "$IOS_DEVICES_LIST" if [ "$(nl "$IOS_DEVICES_LIST")" == "" ]; then - echo "❌ iOS device not deteceted, reconnect it and try again" + echo "❌ iOS device not detected, reconnect it and try again" ctrlc fi From e1e2bd07553af139b81b00a6a27eeaa3db604e44 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:32:57 +0100 Subject: [PATCH 09/24] fix indent --- ios/irecord | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/irecord b/ios/irecord index 272354e8..66cb2b54 100755 --- a/ios/irecord +++ b/ios/irecord @@ -65,9 +65,9 @@ pick_recording_device(){ start_recording(){ RECORDING=true - FILENAME="$DEVICE_NAME-$(date +%Y-%m-%d-%H-%M-%S).mp4" - echo "📹 Recording screen on $DEVICE_NAME, stop it with ctrl^c" - videosnap -w 0 -p High -d "$DEVICE_NAME" "$FILENAME" &> /dev/null + FILENAME="$DEVICE_NAME-$(date +%Y-%m-%d-%H-%M-%S).mp4" + echo "📹 Recording screen on $DEVICE_NAME, stop it with ctrl^c" + videosnap -w 0 -p High -d "$DEVICE_NAME" "$FILENAME" &> /dev/null } check_videosnap_dependency From cd81516c9c688720ecfe9f99d14fcf3a78229341 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:39:17 +0100 Subject: [PATCH 10/24] update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 450e19e6..d005b209 100644 --- a/README.md +++ b/README.md @@ -220,8 +220,12 @@ _Note: This repository is mainly focused on macOS compatibility, but majority of * `iscreenshot -a` Take screenshot on all connected devices ### 🎥 irecord -* Run QuickTime and open video source picker (so you can choose a device right away) - * You may have to allow some system permission, so the script can access the picker +**Required**: Install [videosnap](https://github.com/matthutchinson/videosnap/release "videosnap") +* Download and run `videosnap-0.0.6.pkg` + +1. `irecord` Record screen +2. End recording using `ctrl + c` +3. Save screen video footage to ~/Desktop ### 🖼 igif **Required**: Install [ffmpeg](https://www.ffmpeg.org/ "ffmpeg") `brew install ffmpeg` From 6859f3f0f58d76c3fcab6fc1b0232a2ead32f4f9 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:40:03 +0100 Subject: [PATCH 11/24] update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d005b209..76a11b24 100644 --- a/README.md +++ b/README.md @@ -220,8 +220,7 @@ _Note: This repository is mainly focused on macOS compatibility, but majority of * `iscreenshot -a` Take screenshot on all connected devices ### 🎥 irecord -**Required**: Install [videosnap](https://github.com/matthutchinson/videosnap/release "videosnap") -* Download and run `videosnap-0.0.6.pkg` +**Required**: Install [videosnap](https://github.com/matthutchinson/videosnap/release "videosnap") -> download and run `videosnap-0.0.6.pkg` 1. `irecord` Record screen 2. End recording using `ctrl + c` From f570cd2386675fcbb591791e7c60230974a2522c Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:40:57 +0100 Subject: [PATCH 12/24] update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 76a11b24..0396559a 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ _Note: This repository is mainly focused on macOS compatibility, but majority of * `iscreenshot -a` Take screenshot on all connected devices ### 🎥 irecord -**Required**: Install [videosnap](https://github.com/matthutchinson/videosnap/release "videosnap") -> download and run `videosnap-0.0.6.pkg` +**Required**: Install [videosnap](https://github.com/matthutchinson/videosnap/releases "videosnap") -> download and run `videosnap-0.0.6.pkg` 1. `irecord` Record screen 2. End recording using `ctrl + c` From 382e0c4ec8ee33d81f83dfe582340044bb0aba32 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:45:19 +0100 Subject: [PATCH 13/24] update changelog --- changelog.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 05075d95..ae8b3728 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,2 +1,3 @@ - 🩹 fix iOS device pairing - 🩹 fix Android emulator telnet authentication \ No newline at end of file + ✨ irecord now works using terminal only! + 👏 special thanks to matthutchinson for his videosnap project + 👀 see https://github.com/matthutchinson/videosnap From 9dd3d5385861d215e39d83d6c0e367d4ac4fd457 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:56:15 +0100 Subject: [PATCH 14/24] fix aemulator start for API 29+ --- android/aemulator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/aemulator b/android/aemulator index 5b2c30f9..2c0af21c 100755 --- a/android/aemulator +++ b/android/aemulator @@ -64,7 +64,7 @@ launch_emulator(){ launch_emulator else echo "🚀 Launching emulator..." - nohup "$ANDROID_HOME"/tools/emulator -avd "$EMULATOR_NAME" -no-snapshot &> /dev/null & + nohup "$ANDROID_HOME"/emulator/emulator -avd "$EMULATOR_NAME" -no-snapshot &> /dev/null & rm "$LOCAL_EMULATOR_LIST" fi } From 33bbd40aba3d7d93a6f3a1463509c3e91e94903a Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:57:19 +0100 Subject: [PATCH 15/24] update changelog --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index ae8b3728..fc42d84c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ ✨ irecord now works using terminal only! 👏 special thanks to matthutchinson for his videosnap project 👀 see https://github.com/matthutchinson/videosnap + 🩹 fix aemulator start for API 29+ From 4eda567b57d1113c19a042e505a1b74b4213e2bb Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 12:59:22 +0100 Subject: [PATCH 16/24] update PR template --- .github/PULL_REQUEST_TEMPLATE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a3c15a5c..6bf76bb5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -🤔 **Check all before merging!** -- [ ] 📈[Project board](https://github.com/IntergalacticPenguin/mobile-toolkit/projects/1) up to date +🚨 **Check all before merging!** - [ ] 🏗 Everything implemented thoroughly - [ ] 🔨 All changes tested - [ ] Change #1 From 124a70914158522cbf073c2786879371d179bea1 Mon Sep 17 00:00:00 2001 From: Intergalactic Penguin Date: Wed, 28 Oct 2020 13:41:58 +0100 Subject: [PATCH 17/24] update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0396559a..7d581a0a 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,10 @@ _Note: This repository is mainly focused on macOS compatibility, but majority of * Reboot the device ### 📱 aemulator +**Required**: Make terminal use Android Studio Java + * **Edit .bash_profile** (or .zshrc if you have zsh shell) `open -e ~/.bash_profile` or `open -e ~/.zshrc` + * **Add the following line at the end of the file** `export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'`` + * Android emulator supports all listed scripts by default + extra actions listed below * `aeimulator