Skip to content
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

Fix totally failed API #90

Merged
merged 15 commits into from
Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions app/src/androidTest/AndroidManifest.xml

This file was deleted.

3 changes: 0 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.crosswordToLearn">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:icon="@mipmap/ic_launcher"
android:label=""
Expand Down
21 changes: 12 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@ jobs:
steps:
- bash: |
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-${{ value }};google_apis;x86'
# -d 9 for Nexus 5X
# -d 17 for Pixel
# to find out other devices run "avdmanager list device"
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-${{ value }};google_apis;x86' -d 9 --force
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-${{ value }};google_apis;x86' -d 17 --force

$ANDROID_HOME/emulator/emulator -list-avds

echo "Starting emulator"
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -skin 1080x1920 -no-snapshot > /dev/null 2>&1 &
# increase memory size to 2048M to avoid error "System UI is not responding"
# in the regex \1 means "hw.ramSize=", so we replace number that is placed after "hw.ramSize=" to 2048M.
# More details https://stackoverflow.com/a/4609965/3914914
sed -i 's/^\(hw.ramSize=\).*$/\12048/' ~/.android/avd/xamarin_android_emulator.avd/config.ini
# solution from https://stackoverflow.com/a/16402304 to fix error "System UI is not responding"
sed -i 's/^\(hw.mainKeys=\).*$/\1yes/' ~/.android/avd/xamarin_android_emulator.avd/config.ini
# solution from https://stackoverflow.com/questions/9322540/how-to-change-the-android-emulator-ram-size-from-the-command-line
sed -i 's/^\(vm.heapSize=\).*$/\1256/' ~/.android/avd/xamarin_android_emulator.avd/config.ini
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -gpu swiftshader_indirect -no-window -skin 1080x1920 -no-snapshot -no-audio -no-boot-anim -accel auto -qemu > /dev/null 2>&1 &
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'

$ANDROID_HOME/platform-tools/adb devices
Expand All @@ -49,12 +57,7 @@ jobs:
displayName: 'Run Android Emulator'

- bash: |
$ANDROID_HOME/platform-tools/adb shell """
mount -o rw,remount rootfs /;
chmod 0777 /mnt/sdcard;
exit
"""
sleep 10
$ANDROID_HOME/platform-tools/adb uninstall com.example.crosswordToLearn
$ANDROID_HOME/platform-tools/adb logcat -c
$ANDROID_HOME/platform-tools/adb logcat > $(Build.ArtifactStagingDirectory)/device-${{ value }}.log &
echo $! > logcat.pid
Expand Down