bug: CAPACITOR_ANDROID_STUDIO_PATH does not work with JetBrains toolbox managed shell scripts.
See original GitHub issueBug Report
Capacitor Version
Latest Dependencies:
@capacitor/cli: 3.3.2
@capacitor/core: 3.3.2
@capacitor/android: 3.3.2
@capacitor/ios: 3.3.2
Installed Dependencies:
@capacitor/cli: 3.3.2
@capacitor/android: 3.3.2
@capacitor/core: 3.3.2
@capacitor/ios: 3.3.2
Platform(s)
MacOs
Current Behavior
JetBrains ToolBox has integrated shell scripts that point to the latest Android studio version installed. (see here). This is done because each release incorporates the build ID on the path, so a hard coded path will always break after a version update.
Setting the path of the generated studio.sh
script into CAPACITOR_ANDROID_STUDIO_PATH
fails with:
[error] Unable to launch Android Studio. Is it installed?
Attempted to open Android Studio at: /usr/local/bin/studio.sh
You can configure this with the CAPACITOR_ANDROID_STUDIO_PATH environment variable.
Expected Behavior
We could be able to give this script to open capacitor projects.
Code Reproduction
–
Other Technical Details
The generated script looks like this:
#!/bin/bash
#Generated by JetBrains Toolbox 1.22.10740 at 2021-11-18T10:21:56.087264
declare -a ideargs=()
declare -- wait=""
for o in "$@"; do
if [[ "$o" = "--wait" || "$o" = "-w" ]]; then
wait="-W"
o="--wait"
fi
if [[ "$o" =~ " " ]]; then
ideargs+=("\"$o\"")
else
ideargs+=("$o")
fi
done
open -na "/Users/my-user/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7784292/Android Studio.app/Contents/MacOS/studio" $wait --args "${ideargs[@]}"%
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Generate shell scripts does not work : TBX-6792
I have enabled "Generate shell scripts" in Jetbrains toolbox but the "idea" script is not generated. script name is set to "idea" and...
Read more >JetBrains Toolbox does not generate shell scripts : TBX-4495
Hi, what it says in the title. OS: Ubuntu 18.04 LTS (Elementary OS) Toolbox install location: ~/.local/share/JetBrains/Toolbox. Steps to reproduce:.
Read more >Jetbrains Toolbox not generating Shell Scripts.
Then went to settings and enabled "generate shell scripts". The location is set to usr/local/bin. Still I'm not able to run the PyCharm...
Read more >Toolbox command-line script is unable to start "diff" tool on ...
These arguments are not opened or inter- preted by the open tool. Plain text. but the shell script generated by Jetbrains Toolbox is...
Read more >toolbox app does not install shell scripts : TBX-3371 - YouTrack
What steps will reproduce the issue? enable "generate shell scripts" in toolbox settings; set scripts directory to /Users/christoph/bin; uninstall IDEA and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can put this in your
.zshrc
or.bashrc
as a workaround:It would be better if that location is checked as well by default on Apple hardware.
I use MacOS and I had to remove quotes from the first line for it to work. Thanks for sharing!