How to Hot Reload flutter when running from xcode - xcode

I'm trying to do Hot Reload when running flutter code from xcode but nothing I seem to do works.
I see a console within xcode. I can see my logs there but I don't see the normal "Flutter run commands" output. When I type "r" or "R" there it just writes "r" or "R" with no change to my running app.
I have tried running flutter run from the terminal and I also can't type "r" or "R" without it only typing that letter into the console.
I can do do hot reload via VSCode but I'm running into this issue (I can temporarily fix this issue but it comes up every other build).

I was able to debug my flutter code that was ran from xcode by attaching a flutter debugger.
I had to use VScode to attach the debugger. I installed the flutter extension. Second, I searched for the commend Flutter: Attach to Flutter on Device. Once you have that running, there are options to click to hot reload or hot restart.

The Xcode console doesn't work the way you're trying to do so.
Here are a few commands to Clean, Build and Run Xcode Project. Also there is no hot reload in Xcode. You can simply use these commands anywhere in Xcode except Console.
Shift + CMD + K to clean.
CMD + B to build.
CMD + R to run.

Related

programmatically xcode build(ios library) -is it possible?

I have mac descktop app(flutter, small obfuscator for objective-c code). after obfuscation of the source code, the user builds a ios library in XCode. is it possible to start the build process from my application?
These my options are:
Xcode Command Line Tools - it's very similar, but looks a bit complicated.
Also, I don't know yet how to use the terminal (terminal commands) in the desktop application - is it even possible?
fastlane -this tool is more for deployment. can i use this to build locally?
What do you recommend? maybe there are other options?
read below documentaion and set flutter path so it can be runable in terminal or you can get help from youtube to set flutter path
then simply open terminal and run below comands one by one
1.open -a simulator
this command open ios emulator
write cd and drag your project folder path
cd .../example
flutter run
✅your app launch in emulator
flutter path set details
https://docs.flutter.dev/get-started/install/macos

macOS Terminal Process completed on any click

My macOS terminal is showing Process completed when I type any thing. I am not able to type or do anything on terminal (This effect my Android Studio and VsCode terminal also they just open close in an second) So all issue are causing with this terminal I try every thing restore profile etc nothing is working for me.
But one thing is strange here when I restart my Mac terminal works fine but after I work on android studio or vscode with Mac terminal (Not there default terminal because they are not working) After 1 hour same happen as I say before and as in screenshot.
On different questions solutions was to type /bin/bash -x on terminal but I can't even type single character on this.
I am finding solution for this from 1 week and not able to find any thing I need to restart me laptop every 1 hour to work.
I am using BigSur with M1 processor.
Also it was working fine before but I work on Flutter so I have set path and run commands like
Run: nano ~/.zshrc
Add: export PATH=[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin:$PATH
Run: source ~/.zshrc
And some bash commands to set path.

Unable to run a dart program inside VS code

I am new to Dart/flutter. I have installed flutter SDK and VS Code on windows 10 machine, updated the system path, run flutter doctor, which shows that flutter is indeed installed (flutter doctor output). I read that installing flutter is enough, and I don't have to install Dart SDK too, as it comes build in with flutter (please correct me if I am wrong).
I wrote a very short Dart code for testing, but I couldn't run it from VS Code terminal (run in terminal output), as it returns the following error: "bash: dart: command not found".
But when I debug the code in VS Code, it returns the expected output (debug output).
Can someone please explain to me if I am doing something wrong, or if I am missing something? Why can't I run the program from the bash terminal?
Thanks
You should enter the full path directory instead of file name. For doing so right click on the dart file then choose Copy Path.
Then run following code on terminal:
dart (paste main file path)
For more information about creating and running Dart console application using VSCode please check out THIS answer.

Run Cuda project in XCode

I found some great tutorials about CUDA but they are for windows.
All I want is to get started a.s.a.p.
I made my project files with CMake.
If I press the play button in XCode then I can see "Build succeeded".
I added std::cout << "Hello World!"; cause I would love to see some console output. But I don't see anything.
I did activate the console.
What are the necessary steps to make it working?
Pressing the play button is not enough in this case.
In the Debug folder there was the build:
(to run it you can check: Running an executable in Mac Terminal)

Emulate Run button in Xcode from command line

I'm looking for a way to build and run my app in the simulator from the command line. I need it to behave the same way as when you press Run in xcode.
I can build it with xcodebuild and I tried using simulator with -SimulateApplication option. My app launched but my tests didn't start executing (as they do when run from xcode).
I tried the script I found here and few other AppleScripts I found on the web. They didn't work for me. Commands like build and clean were ignored and others would throw errors. Maybe it's because I use xcode 4. Please help.

Resources