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
#!/usr/bin/env python3 | |
import os | |
import sys | |
import signal | |
import datetime | |
def log(text): | |
now=datetime.datetime.now().strftime("%H:%M:%S.%f") | |
print("@"+now+" <"+ANDROID_SERIAL+"> " + text) |
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
@RunWith(AndroidJUnit4.class) | |
@LargeTest | |
public class DetoxTest { | |
@Rule | |
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false); | |
@Test | |
public void runDetoxTests() { | |
// This is optional - in case you've decided to integrate TestButler | |
// See https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md#8-test-butler-support-optional |
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
# Download test butler | |
curl -f -o ~/test-butler-2.2.1.apk https://repo1.maven.org/maven2/com/linkedin/testbutler/test-butler-app/2.2.1/test-butler-app-2.2.1.apk | |
# Install test butler | |
./platform-tools/adb install ~/test-butler-2.2.1.apk | |
# Launch the test butler background service!!! | |
./platform-tools/adb shell am startservice com.linkedin.android.testbutler/com.linkedin.android.testbutler.ButlerService | |
# Check that the service is indeed running... Expected output is: |
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
# Enable on-screen indicators of taps, swipes and scroll actions. | |
./platform-tools/adb shell settings put system show_touches 1 | |
./platform-tools/adb shell settings put system pointer_location 1 | |
# (*OPTIONAL for Detox users*) Restart adb in root mode (i.e. allow root access to the emulator). | |
# Detox may need this in order to be able to install apps on the emulator in a way more | |
# stable than using "adb install path/to/app.apk". | |
# If you wish to use Detox and avoid that nevertheless, apply the "--force-adb-install" argument | |
# to your "detox test" commands. | |
# See https://github.com/wix/Detox/blob/master/docs/APIRef.DetoxCLI.md#test for more info. |
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
# Gracefully shut the emulator down | |
killall qemu-system-x86_64 | |
# (or, if running headless) | |
killall qemu-system-x86_64-headless | |
### Side-note: If you wish to brutally shut the emulator down without having | |
### anything saved - for whatever reason, you can kill using the SIGKILL signal: | |
killall -9 qemu-system-x86_64 |
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
# Launch the emulator! | |
./emulator/emulator -verbose -no-boot-anim @Pixel_4_API_29 & | |
# (or, if running on a headless machine) | |
./emulator/emulator -verbose -no-boot-anim -no-audio -no-window -gpu swiftshader_indirect @Pixel_4_API_29 & | |
# Wait for the emulator to boot up completely. | |
# This script is actually a bit naive. There are various suggestions out there | |
# as to make this more robust. One alternative is to utilize the "adb wait-for-device" command. | |
booted=0 | |
while [ "$booted" != "1" ] |
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
# Attributes in .ini file: | |
# hw.lcd.density=440 | |
# hw.lcd.height=2280 | |
# hw.lcd.width=1080 | |
# OR, it you need an automated script - they can be simply appended to the existing file: | |
echo "hw.lcd.density=440" > config.ini | |
echo "hw.lcd.height=2280" > config.ini | |
echo "hw.lcd.width=1080" > config.ini |
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
# Install the emulator tool | |
./tools/bin/sdkmanager --install emulator | |
# Install an AOSP image that would later be used as the AVD's OS | |
./tools/bin/sdkmanager --install "system-images;android-29;default;x86_64" | |
# Accept all licenses... | |
./tools/bin/sdkmanager --licenses | |
# To do that automatically in a script, try this: | |
yes | ./tools/bin/sdkmanager --licenses |
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
alias ll='exa -alF' | |
alias lt='exa --tree' | |
alias lt2='exa --tree --level=2' | |
alias lt3='exa --tree --level=3' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
# Git and Github |
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
(https://jenkins-oss.wixpress.com/job/detox-android-61-4-pr/236/consoleFull) | |
Detox log: | |
14:38:48 FAIL [2m03.actions.test.js (210.947s) | |
14:38:48 Actions | |
14:38:48 ✓ [2mshould tap on an element (3662ms)[22m | |
14:38:48 ✓ [2mshould long press on an element (4754ms)[22m | |
14:38:48 ✓ [2mshould long press with duration on an element (4990ms)[22m | |
14:38:48 ✓ [2mshould multi tap on an element (6332ms)[22m |
NewerOlder