What Is the CLI Command To Deploy a Release Build to a Physical iOS Device on a Mac - maui

I've had almost complete failure trying to deploy my MAUI app to a physical device using Visual Studio for Mac. It's like a different error almost every time. So I've resorted to trying to deploy it to my plugged in iPhone using the CLI. I originally started with a command like this:
dotnet build -t:Run -p:_DeviceName=00008101-blahblahblah
It kept throwing errors about not being able to find an emulator with that device ID. So I first did a debug build and deploy using Visual Studio to the device, then I changed my CLI command to this:
dotnet build -t:Run -f:net6.0-ios -c:Release
-p:_DeviceName=00008101-blahblahblah
This also fails with multiple errors, like
'can't find publishing profile'
'AMDeviceSecureInstallApplicationBundle returned: 0xe8008015'
'The command "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.4.447/tools/bin/mlaunch --installdev bin/Release/net6.0-ios/ios-arm64/WatchLikesApp.app/ --devname 00008101-blahblahblah" exited with code 1.
I've been trying to get this to work for like three days. Is there some straightforward way to get this deployed to my locally attached physical iOS device on my Mac?

1. Based on the error AMDeviceSecureInstallApplicationBundle returned: 0xe8008015, it looks like your device is not in the provisioning profiles that you currently have, please refer to this thread for more details.
2. If you want to run the app, you can execute the Run target by adding /t:Run to the command line. Please use the command below to deploy the app to your local iPhone. For more details, you can refer to this thread.
$ dotnet build /t:Run /p:RuntimeIdentifier=ios-arm64 -f net6.0-ios myProject.csproj

Related

Where can I find full prerequisites list for releasing flutter windows desktop app?

I'm absolute newb to flutter, with objective to focus more on windows-desktop apps. It seems that flutter running on windows-desktop require way more DLLs than mentioned on https://docs.flutter.dev/development/platform-integration/windows/building page. I have created and build absolute minimum Flutter application on my dev machine (Win10 22H2). All went fine, starts and runs as expected.
I have then put mentioned DLL in the folder, along the runner app (testapp.exe) and copied over to test machine running Windows Server 2019 Version 1809 as VMWare image. Both Debug and Release versions of Flutter app (testapp.exe) fails. Debug version fails with MessageBox shown "Code execution cannot proceed because MSVCP140D.dll was not found" which I assume is a debug version of msvcp140.dll (this was present in the testapp.exe location while running).
Trying to run Release version produce no error message at all, application is visible in TaskManager for brief second and exits. Running ProcMon against test application shows it seeks numerous other DLLs which were not mentioned in the flutter docs (see attached pic for reference)
Question - is there some more comprehensive list of Flutter windows-build requirements ?

Flutter Integration testing failing when moving between tests

Currently in my project I am adding multiple integration tests separated in different files. When trying to run all tests running using flutter test integration test, it gives me this error when moving between tests
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
TestDeviceException(Unable to start the app on the device.)
This error never occurs when running it on an iOS or Android emulator, but as this is a desktop application, I need to get the tests building on Linux which is where the error is occurring.
maybe this can help you:
sdk version . choose win 11 sdk(10.0.22000.0) in visual studio installer
windows 11 need choose win 11 sdk(10.0.22000.0)
https://github.com/flutter/flutter/issues/93635#issuecomment-969053206
I haven't been able to get my desktop integration tests to work with a single command but if I write each test out as its own command, it works:
flutter test integration_test/features/fast_booking/fast_booking_test.dart --dart-define=FLAVOR=staging --dart-define=FLUTTER_TEST=true;flutter test integration_test/features/appointments/book_appointment_test.dart --dart-define=FLAVOR=staging --dart-define=FLUTTER_TEST=true
It's not the prettiest solution and I'm hoping the Flutter team releases an official solution.
Related Issues
Most of these are Windows specific but they don't solve the problem on MacOS.
https://github.com/flutter/flutter/issues/72985
https://github.com/flutter/flutter/issues/111076
https://github.com/flutter/flutter/issues/93635
https://github.com/flutter/flutter/issues/98890
https://github.com/flutter/flutter/issues/79723

Build error while running the native script application

Migrating my native script application to 8.1.5 version.
Fixed the errors that occurs when migrating the native script application.
Application build successfully in the emulator. After build successfully getting error in the application.
How to fix this issue?
Try this:
Go to AVD Manager, and click wipe data on the selected emulator:
Restart your machine (adb connection might be lost).
Then restart your project by running:
ns clear
ns run android
If that doesn't open the app on the emulator, run:
ns devices
Spot the emulator ID you want to run the app on
ns build android
ns deploy --device EMULATOR-ID
Note:
Make sure you've done all 4 blue steps in the cli message (in blue).

How to publish a desktop application to another computer?

I wrote the first desktop application in Flutter, how can I get the things I need to run this application on another computer?
I found the Release folder (build\windows\runner\Release) with the following contents:
Content
But when I try to run the app, I only see a black screen.
Download Visual Studio 2019 or later it is required.
Download here
https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&channel=Release&source=VSLandingPage&cid=2110&workload=dotnet-cpluscplus
— If there are multiple build tool versions available, install the latest
Windows 10 SDK (10.0.17763.0)
then run one of following command in your project diroctory
flutter build windows
Then go to the release folder you should see the .exe file

Running Flutter Integration Tests in AWS Device Farm, Saucelabs, Firebase Test Lab etc

How do I run flutter integration tests (flutter_driver) non locally within an infrastructure like AWS Device Farm, Saucelabs, Firebase Test Lab?
Running flutter_driver tests on my local machine works smoothly and easily however cloud based mobile testing services don't have the required dependencies installed to utilize Flutter CLI commands.
There are a few places in the Flutter repo that indicate this is possible, however I'm having a hard time finding exactly what needs to happen to make this possible (I have limited experience with Android & iOS integration testing).
A few references I've found:
A comment discussing an integration test in the flutter_gallery: https://github.com/flutter/flutter/issues/18879#issuecomment-400816050
A github issue to add a Firebase Test Lab integration test: https://github.com/flutter/flutter/issues/11718
What do I need to add to my flutter app to allow for remote integration testing inside AWS Device Farm, Saucelabs, Firebase Test Lab etc?
Thanks for your help.
Although we don't officially support the Flutter framework and Flutter tests on AWS Device Farm, we do have a way for you to run these tests using our "custom environment mode" and by pre-selecting a different, supported framework. My advice would be to do the following:
I have a very minimal dummy test for Appium Python, a supported test framework located at https://s3-us-west-2.amazonaws.com/aws-devicefarm-support/test_bundle_slim.zip. Download this from there, and, using the command line tool zip, add your local tests to this zip file, with a command such as "zip -r ~/Downloads/test_bundle_slim.zip flutter-tests/"
Go to AWS Device Farm, setup an automation test run, upload your app, then get to the screen where you select your test type. Choose Appium Python, upload your zip file, and AWS Device Farm will accept the test because of the original dummy Appium Python files we've left in the zip file.
Select "customize your test environment" below there, and a new window below with a YAML test spec file will appear. Put the following lines in the pre-test section of your test spec in place of the existing code used to start an Appium server:
{code}
- >-
if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = "Android" ];
then
# Run EC2 setup code here
curl https://storage.googleapis.com/flutter_infra/releases/beta/linux/flutter_linux_v0.11.3-beta.tar.xz -o flutter_linux_v0.11.3-beta.tar.xz
tar xf flutter_linux_v0.11.3-beta.tar.xz
fi
if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = "iOS" ];
then
# Run Mac setup code here
curl https://storage.googleapis.com/flutter_infra/releases/beta/macos/flutter_macos_v0.11.3-beta.zip -o flutter_macos_v0.11.3-beta.zip
unzip -qq flutter_macos_v0.11.3-beta.zip
fi
- mv flutter ~/flutter
- echo "export PATH=$PATH:$HOME/flutter/bin">> ~/.bash_profile
- export PATH=$PATH:$HOME/flutter/bin
- flutter devices
{code}
Likewise, go to the test section of the test spec file and remove the python test command "bin/py.test" and replace it with your Flutter test command, such as "flutter drive --target=./flutter-tests/main.dart
Save and close this test spec file, and finish setting up the automation run by selecting your devices and setting up their state.
Good luck testing on AWS Device Farm! I have confirmed that these steps do work to setup Flutter properly on our testing platform.
Note: this addresses the assumptions that lead to your question. Not a direct answer to your question.
It is possible to run Flutter integration tests on the cloud using emulators only (no actual devices). The following article describes how to set it up. The article includes a working example on Travis-CI.
Flutter unit, widget and integration testing with IOS and Android emulators on Travis-CI
Source code on GitHub, with a link to the latest build, including integration test results running on both iOS and Android, can be found here. Feel free to clone and use as a starting point for your own project.
Running integration tests on actual devices is probably something you want to do if you are building a complex app with wide distribution (a lot of users), etc...