IntelliJ IDEA Using External Tools/Macros to Execute "ionic run" Using a Keymap - intellij-idea

I'm getting tired of opening and closing the terminal to run small things like ionic run that need to be executed fairly frequently early on in development.
I initially tried a macro, but they don't register double clicking ALT, and opening a new terminal, and eventually closing the terminal. It only registers typing cd mobile, and ionic run. So I found a post on External Tools, but I don't understand how to setup or use them even using the docs. Is there a way to simply:
Open a terminal
Type: cd mobile
Type: ionic run
Close the terminal
that I can keymap?
Or types into the terminal/executes a script file I can drop into a folder and keymap so the terminal doesn't have to open and close.

Related

“launchPackager.command” can’t be opened

Just updated my Mac to the official release of Ventura, and I cannot launch my application via react-native run-ios.
Expected behavior:
running react-native run-ios will launch an Xcode simulator and a terminal window with Metro running.
Current behavior:
Xcode simulator opens, main terminal says app was built successfully, but an error is thrown instead of the metro terminal opening:
“launchPackager.command” can’t be opened because (null) is not allowed to open documents in Terminal.
The simulator just shows a white screen and can't be interacted with.
What I've tried:
manually opening node_modules/react-native/scripts/launchPackager.command
opens Metro terminal but is not connected to the app
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading app...
giving Terminal full disk access (no change)
This happened to me after upgrading to macOS Ventura. I happen to use iTerm as my main terminal, not the built-in Terminal.app so the following fix only applies to that scenario:
Set iTerm as the Default Handler for *.command Files
Open node_modules/react-native/scripts/ in Finder (open node_modules/react-native/scripts/)
Right-Click on launchPackager.command and click Open With then choose Other...
In your Applications directory, select iTerm and click Always Open With
After this, you might need to run npm run ios again from this terminal window. However, from now on, Metro will open in a new iTerm tab instead of trying to open the command in a new Terminal window.
For me, this was the desired behaviour and it removed this warning.
Note In future, any *.command files will now open with iTerm instead of Terminal.
I encountered the same problem as you, I installed another terminal (iTerm2), then randomly found a .command file, and in the display introduction, changed the default opening method to iTerm2enter image description here
I'm having this issue after upgrading my MacOS to Ventura 13.1.
If you don't want to use iTerm as the accepted answer suggest, the workaround I found was to look for the launchPackager.command file inside node-modules/react-native/scripts/ and open this file manually every time you run your app for the first time (specifically when the error pop-up appears). This will open the terminal with metro running already.
I know that manually processes are not the best, but I don't want to use iTerm :)
Using Intel version of apps (Webstorm, Android Studio, other IDE etc...) fixed my problems. I encountered the same issue and thanks to Intel version of Webstorm and Xcode on Rosetta I can able to pod install and other operations.
Note: I'm using Intel version of Android Studio, WebStorm. Also Xcode uses Rosetta 2. No problem detected and everything works perfect. I can able to develop React-Native & Native Android & iOS and Flutter apps without problem. Before that I was using Silicon version of WebStorm and almost no function worked.
Config: MacBook Air, macOS Ventura 13.2 on Apple M1 processor.
For Most of the case you just have to delete node_modules and install modules again (npm i). This happens when project was copied from old mac which had node_modules folder created by the old user, or if the system thinks so
This happened to me after i configured my terminal for the look and feel - but with iterm2, oh my zsh, and powerlevel10k

Vue - build shows infinite loading tab

I have a tiny project with a bunch of images and vuetify.js library
Project works fine with vue serve or npm run serve
I then do npm run build, copy dist folder to my Raspberry Pi Zero v1.3 where it already runs a few other websites and they work fine
But when I open the built project in browser it just gives me infinite loading tab
Browser also throws "this tab is slowing down browser. Stop it?" kinda error
If I DO stop it I sometimes get this warning in console
"Script terminated by timeout at:" referring to chunk-vendors.js in FireFox or "RESULT_CODE_HUNG" in Chrome
Do I need to deploy code on the same computer I develop it on? Are there any spec requirements or do I need npm packages or something?
Also when I open the tab I can hear the fans in my PC speed up a bit if that helps
Also if I stop the tab the HTML structure is being shown but without images. Can that be the cause of this?
What version of vuetify.js are you using, there was a bug before version 3 in the v-slider: https://github.com/vuetifyjs/vuetify/issues/4746

gradlew build not working in VSCode when I try to export my Minecraft mod

So I finished my Minecraft mod and I tried to export it, so I typed ./gradlew build in Visual Studio's Terminal and it's not throwing errors or anything at me, it's just not working. Like, it literally doesn't do anything but go to the next line. I use a Mac, by the way
Okay, so if anyone has this same problem in VSCode, click the little elephant on the left side of the screen, then a bunch of folders will appear. Scroll through the folders until you find the folder named "build setup", open it. Next, find "wrapper" in the folder, hover your mouse over it, and then click the play button to make the wrapper. If you did this correctly, ./gradlew build(or .\gradlew build on Windows) should work!

react native debug tools and techniques?

I'm working on a RN app in VS Code. I'm using an Android AVD loaded from AS. My Android emulator is currently displaying the following error: "Could not connect to development server." I've seen the following debug steps listed as part of an answer to a similar question on SO:
Open the in-app Developer menu.
Go to Dev Settings → Debug server host for device.
Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081).
Go back to the Developer menu and select Reload JS.
But I don't see a way to "Open the in-app Developer menu" via my AVD:
Alternatively, I get the impression that react-devtools could potentially be used to help with debug purposes for a RN app. When I launch the React Dev Tools, RDT states that I should add the following line of code to the top of the page that I want to debug, before importing React DOM:
<script src="http://localhost:8097"></script>
I'm not totally clear on this instruction. My app has App.js and it has child components. Am I supposed to insert this line of code as the first line of code in App.js or some other file? I currently have this as the first line in App.js but it doesn't seem to have any effect. Should I be using this hook differently or am I way off base in some other way here?
Please execute this command from the command: adb reverse tcp:8081 tcp:8081
Then run the project again.

How to Allow quick development in Appcelerator Studio?

How do I re-enable the below behavior?
I USED to have the below behavior...now I don't. I have to re-compile the whole project for every change which is killing productivity for me.
I cut and pasted the below text from another question as it explains it much better than I can....
For an iphone simulator build, the .js files are run directly by the simulator without going through the compile step needed for a distribution build. While this saves some time by itself, the real advantage is that the simulator will dynamically use whatever changes you make to a .js file when you navigate to a window using an external .js reference (i.e. the url property). So changes to app.js still need to relaunch the project. But for windows opened later, you can navigate to the window to see how it looks or test code, then just hit the back button in the navigation bar, tweak the .js, and navigate back to the desired window and immediately see the new layout or test the code changes.
This makes tweaking UI layout stuff incredibly fast compared to the android emulator, not to mention code/debug cycles for some *.js logic is as quick as backing up a screen, revising the code, and showing the screen again. Then when you get the logic worked out, switch to android and retest.
If you have Appcelerator Studio (not Titanium Studio) you can enable LiveView, which attaches a filesystem service to your project and pipes file changes at runtime, bypassing the build process. (aka hotloader, etc)
A) Turn on in Studio
B) Use the command line:
ti build -p ios —-liveview
Be sure you have the latest updates from Appcelerator to ensure parity with target compilers.
$ sudo npm install -g appcelerator
$ appc use latest
$ appc setup
If you don't have Appcelerator Studio, you could try third party solutions such as TiShadow:
$ sudo npm install -g tishadow
$ ti build -p ios --shadow
$ tishadow server
$ tishadow # run --shadow
The quickest development feature you can use is LiveView. In Appcelerator Studio, before you run the project you have a little eye icon in the toolbar to enable live view. Then Every change you save to your project will automatically refresh the emulator/device on which you are running.
You can also have a look at a project called TiShadow which basically does the same and is not related to the Studio.