-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup to support emulator only #7
base: master
Are you sure you want to change the base?
Changes from 1 commit
8dead83
3261bb9
ffecea3
4d4f7eb
09a6228
8dcb5b0
3eb19dd
808fe85
6c2ab91
7503a6d
d4811b5
95a7ded
721dd47
0d0d685
a8b5b65
bb9608b
6ac98ae
470eea7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ FROM alpine:3.4 | |
|
||
MAINTAINER Anton Malinskiy <[email protected]> | ||
|
||
ENV PATH $PATH:/opt/platform-tools:/opt/gnirehtet-rust-linux64 | ||
ENV PATH $PATH:/opt/platform-tools | ||
|
||
RUN set -xeo pipefail && \ | ||
mkdir -m 0750 /root/.android && \ | ||
|
@@ -20,14 +20,7 @@ RUN set -xeo pipefail && \ | |
rm "/root/.wget-hsts" && \ | ||
rm "/tmp/glibc.apk" "/tmp/glibc-bin.apk" && \ | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y && \ | ||
curl -sL -o gnirehtet.zip https://github.com/Genymobile/gnirehtet/releases/download/v2.3/gnirehtet-rust-linux64-v2.3.zip && \ | ||
echo "561d77e94d65ecf2d919053e5da6109b8cceb73bffedea71cd4e51304ccaa3d3 gnirehtet.zip" | sha256sum -c && \ | ||
mkdir -p /opt && \ | ||
unzip gnirehtet.zip -d /opt && \ | ||
chmod +x /opt/gnirehtet-rust-linux64/gnirehtet && \ | ||
mv /opt/gnirehtet-rust-linux64/* / && \ | ||
rm -R /opt/gnirehtet-rust-linux64 && \ | ||
rm gnirehtet.zip && \ | ||
rm -r /var/cache/apk/APKINDEX.* && \ | ||
npm install rethinkdb | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,5 @@ | |
|
||
while read d | ||
do | ||
if [ -z "$STF_PROVIDER_PUBLIC_IP" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keep in mind that despite the comment below, STF_PROVIDER_PUBLIC_IP variable is not a marker of "real devices". |
||
# real devices | ||
timeout -t 3 adb -s $d reboot | ||
timeout -t 3 adb -s $d reconnect | ||
else | ||
date > /tmp/reboot | ||
fi | ||
adb -s $d reconnect | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would keep the timeout to ensure quicker workaround, because adb command can easily get stuck for a long time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added timeout |
||
done < "${1:-/dev/stdin}" |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
DL=/tmp/devices_list | ||
PKG=com.genymobile.gnirehtet | ||
|
||
rm -f $DL | ||
touch -f $DL | ||
sleep 10 | ||
|
||
cd / || exit | ||
|
||
function setup_gnirehtet { | ||
local DEVICE=$1 | ||
|
||
if (echo -n | adb -s $d shell pm list packages | grep -q $PKG); then | ||
echo Already have $PKG | ||
else | ||
echo Not installed $PKG | ||
echo -n | timeout -t 30 ./gnirehtet install $DEVICE | ||
echo -n | timeout -t 30 adb -s $d reverse localabstract:gnirehtet tcp:31416 | ||
echo -n | timeout -t 30 adb -s $d shell am broadcast -a com.genymobile.gnirehtet.START -n com.genymobile.gnirehtet/.GnirehtetControlReceiver --esa dnsServers 10.120.1.123 | ||
fi | ||
} | ||
|
||
function cleanup_gnirehtet { | ||
local DEVICE=$1 | ||
echo -n | timeout -t 30 ./gnirehtet stop $DEVICE | ||
echo -n | timeout -t 30 ./gnirehtet uninstall $DEVICE | ||
} | ||
|
||
function clean_agoda_staff { | ||
local DEVICE=$1 | ||
|
||
|
@@ -70,14 +50,6 @@ while sleep 1; do | |
|
||
kick_rebooter $d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unless you install the rebooter app on emulators, this can probably be removed, together with the function definition above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
if [ "$GNIREHTET_ENABLED" = "true" ]; then | ||
echo Gonna setup gnirehtet for $d | ||
setup_gnirehtet $d | ||
else | ||
echo Gonna cleanup gnrehtet for $d | ||
cleanup_gnirehtet $d | ||
fi | ||
|
||
clean_agoda_staff $d | ||
done | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
* * * * * /bin/bash /metrics.sh | ||
* * * * * /bin/bash /usb-rebind.sh | ||
* * * * * /usr/bin/node /label.js | ||
* * * * * /usr/bin/node /metrics-battery.js | ||
* * * * * /usr/bin/node /device-status-monitor.js | /bin/bash /adb-reconnect.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this line as well. it installs rust as a requirement for gnirehtet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done