.net MAUI not able to debug on physicle iPhone - ios

I've been following this blog for getting started with MAUI on macOS.
https://dev.to/davidortinau/installing-net-maui-on-macos-4mmc
I have everything set up as instructed but the tutorial only show how to start your project on the ios simulator.
I tried plugging my iPhone UUID into this command below but it gives me an error saying that it couldnt find the simulator. I dont want it to run on simulator. I need to find a way to start the app in the physical iPhone.
dotnet build -t:Run -f net6.0-ios -p:_DeviceName=:v2:udid=02C556DA-64B8-440B-8F06-F8C56BB7CC22
I'm on version 6.0.102
Has anyone been having the same issue?

If you want to use a physical device, don't use the :v2:udid= prefix. So the command simply becomes: dotnet build -t:Run -f net6.0-ios -p:_DeviceName=02C556DA-64B8-440B-8F06-F8C56BB7CC22

Related

Flutter on OSX M1 Mac gives error on xcode_backend.sh, about xcode project version when building for simulator

I'm on an M1 Mac Mini, Monterey 12.0.1, with XCode 13.1 & it's command-line tools and freshly-installed Flutter MacOS 2.8.0. I create a base Flutter project with
flutter create appname
When I do "flutter run" in the ios folder (in the parent folder it launches ok in Chrome), I get the message:
Could not build the application for the simulator.
Error launching application on iPhone 13.
I tried it with the simulator running, and not. It looks like the Runner XCode project build stages runs a script, xcode_backend.sh. I also tried loading the project in the XCode UI to build and get 'Command PhaseScriptExecution failed with a nonzero exit code' on that script.
If I go and run this script directly, from the project folder of the ios folder:
guy#Guys-Mac-mini ios % /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh"
I get the message:
error: Your Xcode project is incompatible with this version of Flutter. Run "rm -rf ios/Runner.xcodeproj" and "flutter create ." to regenerate.
I tried the steps indicated, which I also found on Google, and removed the folder and regenerated the project, but the same message is appearing. (I did export the FLUTTER_ROOT environment variable, both in the shell and it's also defined in the XCode project settings.
I can build and run the flutter apps to Chrome, but not for the iOS simulator. I also have no problem building and running Swift apps I've coded on the simulator.
I got my Windows and Android setup running in minutes, but on the M1 Mac it's been hours without success. Any ideas?
I'm a developer with decent of experience, but this is my first stab at Flutter and cross-platform (other than Xamarin). Any help is appreciated.
I can't fully explain it, but the problem I was having was related to my having the project files on an SMB share I was accessing from the Mac.
I setup the project on an SMB share so I could access it from my Windows and Mac workstations. I found that any flutter project on that share would fail compilation.
To test this, I created a new flutter app on my Mac Documents folder, comiled and ran it succesfully in the iOS simulator using 'flutter run'. When I moved that project to the SMB share and tried to run it, I got the compilation error again, and it wouldn't run (I also tried clean and run). I moved the project back to the local drive Documents folder, and was able to run it again.
I also noticed that the Mac access to the SMB share is painfully slow, though I tried a required_signon fixes from
https://kb.synology.com/en-us/DSM/tutorial/What_can_I_do_to_fix_slow_SMB_file_transfers_on_OS_X_10_11_5 but it didn't help.
I had even tried to factory reset my Mac, and I thought that fixed it, but it was only because I hadn't connected to the share yet, and made a test project on the local drive.
PS: I don't expect to use the exact same Flutter project between the Mac and Windows workstations because of paths and SDK locations, but I am using it as a convenient place for transfering the source files.
My team was able to solve this by supplying an absolute path to the xcode_backend script in a run phase and running it. Running it once seemed to be enough and we could remove it thereafter:
/bin/sh "/absolute-path-to-flutter/packages/flutter_tools/bin/xcode_backend.sh" thin
/bin/sh "/absolute-path-to-flutter/packages/flutter_tools/bin/xcode_backend.sh" embed

ionic cordova run ios - nothing happens

I'm trying to deploy my Ionic app to an iPhone by running either of these commands:
ionic cordova run ios
ionic cordova run ios --device
The console displays the following text:
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
If we look at the console output everything seems to be fine, but my iPhone doesn't detect anything and the application doesn't run. I managed to get it on my phone by opening the workspace file inside the platforms/ios and running it with Xcode, but that's a pretty tedious process, and I'm sure that's not the way to go, as it doesn't support livereload.
Also, I tried to start a new project and I'm having the same issue, so I guess it's not any plugin's fault.
Thanks in advance for your answers.
When you run the app from Xcode, does Xcode give you any more error messages in its output window? This may be a signing issue.
same error here from console.
with --verbose
get this message
registerShutdownFunction.process.exit/normal shutdown

Running RoboVM/libgdx iOS app

I'm trying to develop an iOS app using RoboVM and libgdx. So far, I've just created a simple project, and have been trying to get it to run on iOS. So far, the farthest I've gotten is running this command:
robovm -verbose -arch x86 -os ios -cp robovm/lib/robovm-objc.jar:robovm/lib/robovm-cocoatouch.jar -jar <project>.jar
This generates a directory with a file called Info.plist, a file called <package_name>.<main_class>, and a lib directory. The file called <package_name>.<main_class> is a Mach-O executable i386. How would I go about running the file, and how would I go about uploading it to an iPhone as an app? There doesn't seem to be much documentation on RoboVM, and I've never really used a mac before, so I apologize if I'm missing something obvious.
Edit: To clarify, I want to both know how to run the app that was generated by RoboVM after I ran the command above, and to know how to upload that app to an iPhone to run it there. Preferably, I'd like to do this all without the RoboVM eclipse plugin.
Did you use the setup UI of libgdx? If so you can easy run the project:
iOS RoboVM: Right click the robovm project, Run As -> iOS Device App to run on a connected device, or Run As -> iOS Simulator App to run on the iOS simulator. If you run on a device, you need to provision it to be able to deploy to it! [Link about how to start developing with libgdx]
Install roboVM plugin for eclipse. Create the Projects with the setup UI. (Core and RoboVM) And rightclick the robo project Run As -> iOS and it should work.
You do not run it with commandline if you use libgdx. You are missing alot of lib and backend stuff from libgdx which need to be compiled too.
Moreover if you want to upload it to a device you need an Provision.

How to install cordova(phonegap) ios app to device via cli and not via xcode

I am trying to create a simple project with last phonegap version:
$ phonegap create my-project
$ phonegap build ios
$ phonegap install ios
All works perfectly and I see emulator with my simple application.
But I can't find documentation on how to run my application on device(iphone, for example) and not on a simulator.
All documentation by cordova / phonegap based on examples with cordova's template for xcode.
But last cordova's version don't have template for xcode and all that I need - cli, if I understand correctly?
I already registered as IOS developer and I have a valid iPhone development certificate.
When I connect my device - I can see it in xcode and I can run native application on my device.
But only via xcode.
I will be grateful to any advice.
If the cordova app builds and runs on the simulator, try running cordova run ios --device
This worked for me, when before it was only hitting the simulator.
Alternatively, if that STILL doesn't work for you, when you run codova build ios, to just build the app, you could use itunes to sync the generated .app file in <project_folder>/platforms/ios/build/device/AppName.app
There is an Apple CLI tool canned xcodebuild, as well as this wrapper around it by Facebook. I'd suggest trying out either that or look at the build-in xcodebuild shipped with xcode.
Hopefully one of them will work.
https://github.com/facebook/xctool
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
If you use Cordova CLI, you should be able to do this:
cordova run ios

iOS emulator no longer running from command line using phonegap

My iOS emulator is no longer opening when I run "phonegap run ios" in the terminal on Mac OS X. I receive no error messages and:
[phonegap] Platform "ios" deployed to emulator.
[phonegap] successfully installed onto emulator
While this is currently a known bug, you can run the emulate command more directly (note you need to build separately):
phonegap local build ios
/platforms/ios/cordova/emulate
You can also run the application using the same technique:
phonegap local build ios
/platforms/ios/cordova/run
NOTE: When using this method to run the app on your phone, the task might get stuck on the splash screen. To fix this, launch the Activity Monitor on your Mac and quit any processes with the name "ios-deploy". From there you can launch the application on your phone by clicking the application icon.
Or, you can even look inside the generated /platforms/ios folder and launch XCode project directly to test in an emulator or on your device. Open project and click the RUN button.
IMPORTANT: with all of the above methods, you MUST run the build command before running:
phonegap local build ios
Not really an answer, but I can say this is a known bug. Here is the bug so you can track it:
https://issues.apache.org/jira/browse/CB-5103
I only had this problem after upgrading to 3.1. I downgraded to 3.0 and it works more reliably:
npm uninstall -g phonegap
npm install -g phonegap#3.0
Also had to delete the platform/ios dir and plugins/ios.json and then run 'phonegap build ios' and 'phonegap run ios'

Resources