Created
June 24, 2018 15:08
-
-
Save fionn/bc06bc7e3c05dd6947018c8bea01beda to your computer and use it in GitHub Desktop.
Opens a remote virtual interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Remote virtual interface for a single iPhone | |
udid=$(instruments -s devices | grep -v "Simulator" | grep "iPhone" | awk -F '[][]' '{print $2}') | |
if [ -z "$udid" ]; then | |
echo "No UDID found" 1>&2 | |
exit 1 | |
else | |
echo "Found UDID $udid" | |
fi | |
rvi="rvi0" | |
if [[ $(ifconfig -l) =~ $rvi ]]; then | |
echo "The $rvi interface already exists" 1>&2 | |
exit 2 | |
else | |
rvictl -s "$udid" | |
rvi_success=$? | |
ifconfig -l | |
exit $rvi_success | |
fi | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment