Skip to content

Instantly share code, notes, and snippets.

@fionn
Created June 24, 2018 15:08
Show Gist options
  • Save fionn/bc06bc7e3c05dd6947018c8bea01beda to your computer and use it in GitHub Desktop.
Save fionn/bc06bc7e3c05dd6947018c8bea01beda to your computer and use it in GitHub Desktop.
Opens a remote virtual interface
#!/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