<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christof on Medium]]></title>
        <description><![CDATA[Stories by Christof on Medium]]></description>
        <link>https://medium.com/@christof.thalmann?source=rss-291ea5da3748------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2gDTC-N_8Yoy1L4C7QCnfA.jpeg</url>
            <title>Stories by Christof on Medium</title>
            <link>https://medium.com/@christof.thalmann?source=rss-291ea5da3748------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 05:01:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@christof.thalmann/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Native E2E Testing With Expo and Maestro in 5 steps]]></title>
            <link>https://medium.com/lingvano/native-e2e-testing-with-maestro-and-expo-14e9e9b0f0fe?source=rss-291ea5da3748------2</link>
            <guid isPermaLink="false">https://medium.com/p/14e9e9b0f0fe</guid>
            <category><![CDATA[e2e-testing]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[native-app]]></category>
            <category><![CDATA[maestros]]></category>
            <category><![CDATA[expo]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Mon, 03 Apr 2023 14:45:14 GMT</pubDate>
            <atom:updated>2023-10-12T07:59:00.895Z</atom:updated>
            <content:encoded><![CDATA[<h4>Automated End-2-End Testing</h4><h4>Learn how to implement End-2-End testing for iOS and Android apps and integrate into GitHub CI.</h4><figure><img alt="Native E2E Testing with Maestro and Expo" src="https://cdn-images-1.medium.com/max/1024/1*rlKtCdyGisl_vrveTU2jMg.png" /></figure><p>As a former web developer, it is quite a change to release native apps. The time it takes to ship your changes to production is way longer than deploying your changes on the web.</p><p>Do you struggle with native app testing as well? Luckily, there are some awesome tools to make the workflow for native apps more stable and easier to manage.</p><p>Roll out new releases with ease and confidence! A huge part of native releases is the confidence that everything in the app works fine. Once a release has started, it is impossible to make it undone. We have implemented a lot of automated testing but struggled with native E2E for a long time. We tried many tools like <a href="https://appium.io/">Appium</a> or <a href="https://wix.github.io/Detox/">Detox</a>, but now we have finally found a working solution: <a href="https://www.mobile.dev/">Maestro</a> tackles the problems of native End-2-End testing and even makes testing fun — locally and in <a href="https://cloud.mobile.dev/">CI</a>.</p><p>In the next 5 steps, you will learn how to set up E2E testing for Expo apps with Maestro and create a GitHub CI automation.</p><h3>Prerequisite for this tutorial</h3><p>This tutorial is built for a <a href="https://docs.expo.dev/">React-Native Expo</a> app for iOS, Android and Web. The automation runs in <a href="https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration">GitHub Actions</a>. There is an <a href="https://github.com/lingvano/react-native-eas-maestro">example repository</a>. We recommend setting up a new dummy project. Run these commands:</p><pre>npx create-expo-app maestro-eas-example<br>cd maestro-eas-example<br>eas login<br>eas build:configure</pre><p>Add the bundleIdentifier to <em>app.json</em>. You will later need it to start the Maestro tests.</p><pre>&quot;android&quot;: {<br>  &quot;package&quot;: &quot;com.maestroEasExample.app&quot;<br>},<br>&quot;ios&quot;: {<br>  &quot;bundleIdentifier&quot;: &quot;com.maestroEasExample.app&quot;<br>}</pre><h3><strong>1. Setup Maestro</strong></h3><p>Install Maestro locally. You can also find the guide in <a href="https://maestro.mobile.dev/getting-started/installing-maestro">Maestro Docs</a>.</p><pre>curl -Ls &quot;https://get.maestro.mobile.dev&quot; | bash</pre><p>For iOS emulators, you will need some additional config (replace idOfIOSDevice with the correct ID by running xcrun simctl list).</p><pre>brew tap facebook/fb<br>brew install facebook/fb/idb-companion<br>idb_companion - udid idOfIOSDevice</pre><h3><strong>2. Write your first test</strong></h3><p>Let’s start with a simple test. You can check out how assertions and actions work directly within the <a href="https://maestro.mobile.dev/reference/tap-on-view">Maestro Docs</a>. Create your first test in <em>./maestro/ </em>as <em>test.yaml</em>.</p><pre>appId: com.maestroEasExample.app<br>---<br>- launchApp:<br>    clearState: true<br><br>- assertVisible: &quot;Open up App.js to start working on your app!&quot;</pre><h3><strong>3. Make your first test green</strong></h3><p>Start your app locally and run the Maestro test. Feel free to use expo run:ios or expo run:android. If this tutorial works on one platform, it will also work on the other.</p><pre>expo run:[ios|android]<br>maestro test maestro/test.yaml</pre><h3><strong>4. Prepare GitHub automation</strong></h3><p>Create a public GitHub repository and add your code to your new repository. Add the <a href="https://expo.dev/accounts/[account]/settings/access-tokens">Expo token</a> as a secret to your repository. Create the <a href="https://github.com/features/actions">GitHub workflow</a> <em>./github/workflows/eas-build.yaml </em>(folder structure is important):</p><pre>name: EAS Builds<br>on:<br>  push:<br>    branches: [main]<br><br>jobs:<br>  eas-build:<br>    name: Trigger EAS build for development-sim<br>    timeout-minutes: 15<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: 🏗 Setup repository<br>        uses: actions/checkout@v3<br><br>      - name: 🏗 Setup Node<br>        uses: actions/setup-node@v3<br>        with:<br>          node-version: 18.x<br>          cache: yarn<br><br>      - name: 🏗 Setup EAS<br>        uses: expo/expo-github-action@v8<br>        with:<br>          eas-version: latest<br>          token: ${{ secrets.EXPO_TOKEN }}<br><br>      - name: 📦 Install dependencies<br>        run: yarn install<br><br>      - name: 🚀 Send build request<br>        run: eas build --platform all --non-interactive --no-wait --profile development-sim<br>        shell: bash</pre><p>Maestro <a href="https://maestro.mobile.dev/getting-started/build-and-install-your-app">requires a simulator build</a>. Therefore, you need to create a new profile in eas.json<em> </em>by adding the following block to the buildsobject.</p><pre>&quot;development-sim&quot;: {<br>  &quot;distribution&quot;: &quot;internal&quot;,<br>  &quot;ios&quot;: {<br>    &quot;simulator&quot;: true<br>  }<br>},</pre><p>Add your EAS projectId and owner to the <em>app.json.</em></p><pre>&quot;owner&quot;: &quot;yourEasUser&quot;,<br>&quot;extra&quot;: {<br>  &quot;eas&quot;: {<br>    &quot;projectId&quot;: &quot;yourEasProjectId&quot;<br>  }<br>},</pre><p>For Android builds, you once need to run eas build locally to generate a new Android Keystore.</p><pre> eas build --platform android --no-wait --profile development-sim</pre><p>Commit your changes and push them to your repository. In the GitHub Actions tab, you will see your automation running. Once finished, you can open the step ”🚀 Send build request”. At the end of this command, you will find the links to Expo’s build details. Congrats! <strong>You now have your first automated app build </strong>🎉</p><figure><img alt="Screenshot of GitHub Actions" src="https://cdn-images-1.medium.com/max/1024/1*Uvjd87q-gkKJ4AwdZGVptw.png" /><figcaption>On line 22 and 23 you get the direct links to Expo, where you can download your app builds.</figcaption></figure><h3><strong>5. Add automated E2E testing to your new build</strong></h3><p>Copy the <a href="https://console.mobile.dev/">Maestro API key</a> and add it as a <a href="https://expo.dev/accounts/[account]/projects/[project]/secrets">secret to Expo</a>. Make sure to name the secret MAESTRO_API_KEY<em>. </em>Create the <em>eas-build-on-success.sh</em> file.</p><pre>#!/usr/bin/env bash<br><br>set -eox pipefail<br><br>curl -Ls &quot;https://get.maestro.mobile.dev&quot; | bash<br>export PATH=&quot;$PATH&quot;:&quot;$HOME/.maestro/bin&quot;<br><br>if [ &quot;$EAS_BUILD_PLATFORM&quot; = &quot;ios&quot; ]<br>then<br>   brew install java<br>   echo &#39;export PATH=&quot;/opt/homebrew/opt/openjdk/bin:$PATH&quot;&#39; &gt;&gt; ~/.zshrc<br>   sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk<br>   export CPPFLAGS=&quot;-I/opt/homebrew/opt/openjdk/include&quot;<br><br>   APP_EXECUTABLE_PATH=/Users/expo/workingdir/build/ios/build/Build/Products/Release-iphonesimulator/MaestroEasExample.app<br>else<br>   APP_EXECUTABLE_PATH=/home/expo/workingdir/build/android/app/build/outputs/apk/release/app-release.apk<br>fi<br><br>MAESTRO_API_KEY=$MAESTRO_API_KEY<br>maestro cloud --apiKey $MAESTRO_API_KEY $APP_EXECUTABLE_PATH maestro/test.yaml  </pre><p>In the <em>package.json,</em> you need to add the <a href="https://docs.expo.dev/build-reference/npm-hooks/">eas-build-on-success hook</a>.</p><pre>&quot;eas-build-on-success&quot;: &quot;bash ./path/to/eas-build-on-success.sh&quot;</pre><p>Commit and push your changes again. Your pipeline will run, and after the build is ready, it will automatically start the Maestro test flow. In the Expo build details, you can open “Build success hook”. At the end of this command, you will find the link to Maestro Cloud, where you can see the videos of your test assertions.</p><p>Congrats! 🥳 <strong>Your app is now automatically E2E tested every time you push to your repository!</strong> Make sure to cover all your features in test flows (and use the amazing <a href="https://maestro.mobile.dev/getting-started/maestro-studio">Maestro Studio</a> for that), and you can be confident about your app working fine with every release!</p><figure><img alt="Screenshot of test flows in Maestro Cloud" src="https://cdn-images-1.medium.com/max/1024/1*fpA95OkDNVzSS0Uvq1cX-w.png" /><figcaption>You will find screen recordings of you test assertions in Maestro Cloud</figcaption></figure><h3><strong>Optional step: Optimize your workflow with an error notification system</strong></h3><p>Automatically notify your team if a pipeline fails. We have decided to <a href="https://github.com/lingvano/react-native-eas-maestro/blob/main/scripts/eas-build-on-error.sh">automatically create Asana tickets</a> if an E2E test fails, as it offers space for discussion, and developers can be easily assigned to fix the problem, but you can choose whatever fits you. Just use the <a href="https://docs.expo.dev/build-reference/npm-hooks/">eas-on-error-script hook</a>!</p><h3>As easy as that</h3><p>That’s it! Super simple setup. With these 5 steps, you made sure your iOS and Android app is E2E tested, and integrated automation into your workflow. This will guarantee that new code pushed to your repository does not break anything. Once you have covered your whole app with Maestro test flows, you can now release without worrying about the functionality of your app — if the CI pipeline is green, all is fine 🚀</p><p>Check out and star <a href="https://github.com/lingvano/react-native-eas-maestro">the example repository of this tutorial</a>. Also, have a look at our <a href="https://github.com/lingvano">other projects</a>, where we share some details of the technical setup &amp; infrastructure of our web, iOS, and Android React-Native Expo app. You will soon find other cool stuff there, like auto-submitting your builds to AppStore and PlayConnect, web E2E automation, UI testing, …</p><p>Do you have questions about our setup or ideas for improvement? Just leave a comment! Make sure to follow us to get more insights into our projects and our day-to-day developer life.</p><p>Curious about our app? You can check out our production version on <a href="https://app.lingvano.com/">Web</a>, <a href="https://apps.apple.com/at/app/lingvano-learn-sign-language/id1547252782">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.lingvano.app&amp;hl=de_AT&amp;gl=US">Android</a>. Or follow us on <a href="https://twitter.com/lingvano_tech">Twitter</a>, <a href="https://www.instagram.com/lingvano/">Instagram</a> or <a href="https://www.linkedin.com/company/lingvano-gesbr/">LinkedIn</a>.</p><p>Also, we are always <a href="https://www.lingvano.com/oegs/en/jobs-en/">hiring</a> =) join us!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14e9e9b0f0fe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lingvano/native-e2e-testing-with-maestro-and-expo-14e9e9b0f0fe">Native E2E Testing With Expo and Maestro in 5 steps</a> was originally published in <a href="https://medium.com/lingvano">Lingvano</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Convert Angular Webapp to Android APK in 10 steps]]></title>
            <link>https://medium.com/@christof.thalmann/convert-angular-project-to-android-apk-in-10-steps-c49e2fddd29?source=rss-291ea5da3748------2</link>
            <guid isPermaLink="false">https://medium.com/p/c49e2fddd29</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cordova]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[hybrid-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Tue, 19 Feb 2019 19:01:25 GMT</pubDate>
            <atom:updated>2020-04-03T19:30:21.121Z</atom:updated>
            <content:encoded><![CDATA[<h3>Convert Angular project to Android APK in 10 steps</h3><h4>In this article you will learn how to convert your existing Angular project into a hybrid app running on Android.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TShSyb2O8PkhQtsRLvTJCg.jpeg" /></figure><p>If you are a web developer Angular probably crossed your path a couple of times. Angular (as well as other javascript frameworks like react or vue.js) is a super cool frontend framework to build small and simple up to large and complex web applications.</p><p>As a developer I always try to provide the user the best possible user experience. That once meant that I had to develop a smartphone app instead of a web application. As a javascript enthusiast I didn’t want to start developing in c, c++ or java. So I did some research and quickly came to the conclusion that you can easily develop smartphone apps with a javascript framework as a basis. Building new hybrid apps from scratch is already pretty good documented but I also wanted to update <strong>existing</strong> web projects to be deployed as hybrid apps.</p><p>After this tutorial you will be able to build your <strong>existing</strong> Angular web project as an android mobile app (APK), get it running on your android device and even deploy it to the play store (of course you can also create a new Angular project and setup the APK building process). You should have a basic knowledge about Angular development. There is no further knowledge necessary (Cordova, java, android studio, etc). Please keep in mind that such things as step-by-step instructions in web development are always quite impossible. There are too many differences in each setups and projects to write a one-fits-all tutorial. If questions arise — don’t hesitate to ask. Nevertheless, <strong>let’s get started!</strong></p><p><strong>Step 1</strong><br>Setup <a href="https://developer.android.com/studio/install">Android Studio SDK</a></p><p><strong>Step 2</strong><br>Install Cordova globally</p><pre>npm install -g cordova</pre><p><strong>Step 3</strong><br>I assume that you have an existing Angular project at hand. Otherwise you can quickly create a test project with <strong><em>ng new hello-app-world</em></strong> (If you have never used Angular before, install <a href="https://cli.angular.io/">Angular CLI</a>). Navigate into the newly created project. Run <strong><em>ng serve</em></strong> for a dev server and open <a href="http://localhost:4200/">http://localhost:4200/</a>.</p><p><strong>Step 4</strong><br>Create a new Cordova project</p><pre>cordova create hello-app-world-cordova com.example.hello OurFirstApp</pre><p><strong>Step 5</strong><br>To develop Cordova applications, you must install SDKs for each mobile platform you are targeting. Navigate into the newly created Cordova project and add Android as platform.</p><pre>cordova platform add android</pre><p><strong>Step 6</strong><br>Now merge the just created Cordova project <strong>into</strong> our Angular project. Copy every folder and file of the Cordova project expect the <em>package.json</em>, the <em>package-lock.json</em> and the <em>node_modules</em> folder <strong>into</strong> the Angular project root. The folder structure of your Angular project should now look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*Poo-Fl-uZyaPQOfIPW5Oiw.png" /><figcaption>Folder structure of the Angular project root</figcaption></figure><p><strong>Step 7</strong><br>Merge the Cordova <em>package.json</em> <strong>into</strong> the Angular <em>package.json</em>. You don’t need to copy the scripts object from the Cordova <em>package.json</em>. Overwrite the Angular <em>package.json</em> <em>name</em> with the Cordova <em>package.json name</em>. Everything else should be easy mergeable. The resulting <em>package.json</em> in your Angular project should now look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e0ac3CxAxh7pMNwQOTe-NQ.png" /><figcaption>Structure of the Angular package.json</figcaption></figure><p><strong>Step 8</strong><br>Open the <em>index.html </em>of the Angular project and change the <em>base href </em>from <strong><em>&lt;base href=”/”&gt;</em></strong> to:</p><pre>&lt;base href=”./”&gt;</pre><p><strong>Step 9<br></strong>Go to the <em>tsconfig.json</em> and make sure in <strong><em>compilerOptions</em></strong> the <strong><em>target</em></strong> is set to <strong><em>es5</em></strong>! Angular versions ≥ 8 will have compile <strong><em>target</em></strong> set to <em>es2015</em> (ES6) by default but Android Emulators do have problems with ES6. So set <strong><em>target</em></strong> to <strong><em>es5</em></strong> (ES5). If you don’t have your target set to es5 you will get a white screen on your emulator.</p><p><strong>Step 10</strong><br>On default Angular creates a <em>/dist</em> folder when building your project while Cordova builds its APK into the <em>/www</em> folder. We need to have one unite target path. Go to the <em>angular.json</em> and change the <em>outputPath</em> to “<em>www</em>”.</p><p>Setup is now done. Let’s build our Angular app and then wrap it with Cordova.</p><pre>ng build --prod --aot</pre><pre>cordova build android</pre><p><strong>Hurray!</strong> Now your APK is ready for testing on a virtual Android device. Open Android Studio. Open the Android Virtual Device Manager. Create a new virtual device (hardware and Android version as you like). Start the device. Once the virtual device has booted, you can start the debug APK on your virtual device with this command:</p><pre>cordova emulate android</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VzWFx9NIwnKM7-aU1N-uyg.png" /><figcaption>App running on a virtual Android Device</figcaption></figure><p>It’s that easy. With these few steps you can convert your Angular project as a hybrid app into an Android app for smartphones. *</p><p><em>*It’s also pretty easy with other platforms like iOS.</em></p><p>One small step is yet to come: Our debug APK currently only works on virtual Android devices. In order to be able to install the APK on real hardware Android devices or even make it available in the Play Store we have to release and sign the app. An unsigned APK can not be installed on Android systems. But we can easily sign our APK ourselves.</p><p>First we need to release the app:</p><pre>cordova build --release android</pre><p>This will create an unsigned version of your APK at platforms/android/app/build/outputs/apk/release. To self-sign our APK we need to generate a keystore:</p><pre>keytool -genkey -v -keystore helloappworld.keystore -alias helloappworldmobileapps -keyalg RSA -keysize 2048 -validity 10000</pre><p>The keytool command will prompt you with a password and other certificate fields. After you filled out the fields a keystore file will be generated. Store your keystore very carefully!</p><p>Then we need to sign the java archive package:</p><pre>jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore helloappworld.keystore app-release-unsigned.apk helloappworldmobileapps</pre><p>One last mandatory step if you want to upload the APK to the Play Store (Z<em>ipalign</em> is a tool provided by the Android SDK. If you have configured your <em>$ANDROID_HOME</em> var incorrect, you can find <em>zipalign</em> with this command: <em>find ~/Library/Android/sdk/build-tools -name “zipalign”.</em>):</p><pre>zipalign -v 4 app-release-unsigned.apk app-release-signed.apk</pre><p><strong>That’s it.</strong> Now you have your release-ready and signed APK that you can install on your Android smartphone.</p><p>You can develop and optimize your Android app. Check out the <a href="https://cordova.apache.org/docs/en/latest/">Cordova Docs</a>. You can activate many cool plugins and use features like push notifications, vibration feedback and splash screens or modify simple things like color of the status bar.</p><p>You can also look at the source code and config files of a demo project for this tutorial <a href="https://github.com/christof-thalmann/angular-to-apk">right here</a>.</p><p><strong>Update January 2020</strong>: This Tutorial still works with the latest versions of Angular and Cordova. My Angular version is 8.3.23 and my Cordova version is 9.0.0. Have fun.</p><p>Check out our other cool projects at <a href="https://liechtenecker.at/">liechtenecker.at</a> or the <a href="https://liechtenecker.at/angular-zu-android-apk-in-10-schritten/">german version of this tutorial</a>.</p><p>I hope I could give you a good guide. If you have suggestions for optimization, I am very happy about your feedback. If questions popped up, don’t be afraid to ask.</p><p>Make the web a better place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c49e2fddd29" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>