Skip to content

Commit

Permalink
Merge pull request #202 from IntergalacticPenguin/fix/dependencies
Browse files Browse the repository at this point in the history
Fix iOS device pairing request & Android emulator auth & check depencencies
  • Loading branch information
IGPenguin committed Oct 7, 2020
2 parents 113a766 + 713d001 commit b3cbb8a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 5 additions & 1 deletion android/aemulator
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ check_running_emulator(){
if [[ "$RESPONSE" == "y" || "$RESPONSE" == "Y" ]];
then
launch_emulator
android_wait_for_device
get_token
fi
exit
fi
Expand Down Expand Up @@ -68,10 +70,13 @@ launch_emulator(){
}

get_token(){
check_dependency "telnet"
[ -f ./emulator_console_auth_token ] || echo "localhost 5554" | telnet &> /dev/null
TOKEN=$(cat "$HOME"/.emulator_console_auth_token)
}

telnet_command() {
get_token
if [ -z "$1" ];then
read -r -p "📝 Insert telnet command: " COMMAND
else
Expand Down Expand Up @@ -158,7 +163,6 @@ disable_network_delay(){
}

check_for_update
get_token

case $1 in
'start')
Expand Down
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
🩹 fix alaunch installed package detection
🩹 fix awipe on Android 11
🩹 fix iOS device pairing
🩹 fix Android emulator telnet authentication
10 changes: 5 additions & 5 deletions common_tools
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ ios_wait_for_device(){
}

ios_check_developer_image_and_pairing(){
IS_MOUNTED=$(ideviceimagemounter -u "$1" -l) #Probably does not work on iOS 13
if [[ $IS_MOUNTED == *"error code -21." ]] ; then
read -r -p "❌ Device is not paired properly - reconnect it (one at a time), unlock screen and press ENTER..."
IS_MOUNTED=$(ideviceimagemounter -u "$1" -l)
if [[ $IS_MOUNTED == *"Error"* ]] || [[ $IS_MOUNTED == *"error"* ]] ; then
read -r -p "❌ Device is not paired - reconnect it (one at a time), unlock screen and press ENTER..."
echo "🤝 Requesting pairing..."
idevicepair pair &> /dev/null
read -r -p "❓ Tap \"Trust\" button on the device screen and press ENTER..."
Expand Down Expand Up @@ -395,8 +395,8 @@ check_adb_dependency(){

check_dependency(){
if ! [ -x "$(command -v "$1")" ]; then
echo "⚠️ \"$1\" required!"
should_proceed "🔄 Install via homebrew? (this may take a while)"
echo "💥 \"$1\" command required!"
should_proceed "🛒 Install via homebrew? (this may take a while)"
brew install "$1"
fi
}
Expand Down
1 change: 1 addition & 0 deletions ios/igif
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
LOCATION=$(dirname "$0")
source "$LOCATION"/../common_tools
check_dependency "ffmpeg"
ios_choose_device
trap 'ctrlc $@' 1 2 3 6 15

Expand Down

0 comments on commit b3cbb8a

Please sign in to comment.