You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "GitToTheHub (via GitHub)" <gi...@apache.org> on 2024/10/10 08:03:06 UTC
[PR] Add ZSH config for setting environment variables on macOS Catalina and newer [cordova-docs]
GitToTheHub opened a new pull request, #1360:
URL: https://github.com/apache/cordova-docs/pull/1360
On macOS Catalina and newer, Apple switched from Bash to ZSH. The new file for ".bash_profile" is ".zprofile".
Also the AnroidSDK path is different on a current macOS with the latest Android Studio, but I don't know since when this was changed, or if it was always like this.
### Platforms affected
Android on macOS
### Motivation and Context
Environment variables on newer macOS system must stored on `.zprofile` instead of `.bash_profile`
### Description
### Testing
### Checklist
- [ ] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1830774241
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On macOS versions prior to Catalina or on Linux, use any text editor to create or modify the `~/.bash_profile` file.
+On macOS Catalina and newer, create or modify the `~/.zprofile` file instead, as the default shell has changed.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
Review Comment:
```suggestion
export ANDROID_HOME=/path/to/android-sdk/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1831411049
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
If we wanted to suggest for different OS, we could update the entire section like this?
This keeps your previous suggestion but also includes Linux.
```
Add the following line to your shell's profile to set up the `ANDROID_HOME` environment variable.
**Linux:**
```bash
export ANDROID_HOME=~/Android/Sdk
```
**macOS:**
```bash
export ANDROID_HOME=~/Library/Android/sdk
```
The above examples point to the standard paths where the Android SDK is typically stored. Depending on your environment configuration, the path may differ. Be sure to confirm that the path exist or adjust them to match your local installation.
After setting the `ANDROID_HOME` environment variable, update the `PATH` variable to include directories containing various Android-related binaries.
```bash
export PATH=$PATH:$ANDROID_HOME/platform-tools/
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin/
export PATH=$PATH:$ANDROID_HOME/build-tools/
export PATH=$PATH:$ANDROID_HOME/emulator/
```
```
The above:
* Provide example `export` lines for macOS and Linux, pointing to standard paths.
* Mention that these are **standard paths**, but that the actual path **may differ** depending on your environment configuration.
* Remind you to **confirm that each path exists** and to **adjust paths as needed** to match your installation.
I also revised the instructions above the `export PATH` section to improve flow and make it easier to follow. While it’s helpful to provide cut-and-paste examples, it’s equally important that users review each step, as environments can vary.
If you use the above, make sure to fix the indentation from what I posted it. I had to indent the content to prevent GH from rendering the markdown.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1832433122
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
Ah sorry, I didn't saw Windows has it's own section :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1832420582
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
Sounds good, I will use this suggestion. Does somebody know the path for Windows? I could also add this path to the examples.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1831411049
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
If we wanted to suggest for different OS, we could update the entire section like this?
This keeps your previous suggestion but also includes Linux.
```
Add the following line to your shell's profile to set up the `ANDROID_HOME` environment variable.
**macOS:**
```bash
export ANDROID_HOME=~/Library/Android/sdk
```
**Linux:**
```bash
export ANDROID_HOME=~/Android/Sdk
```
The above examples point to the standard paths where the Android SDK is typically stored. Depending on your environment configuration, the path may differ. Be sure to confirm that the path exist or adjust them to match your local installation.
After setting the `ANDROID_HOME` environment variable, update the `PATH` variable to include directories containing various Android-related binaries.
```bash
export PATH=$PATH:$ANDROID_HOME/platform-tools/
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin/
export PATH=$PATH:$ANDROID_HOME/build-tools/
export PATH=$PATH:$ANDROID_HOME/emulator/
```
```
The above:
* Provide example `export` lines for macOS and Linux, pointing to standard paths.
* Mention that these are **standard paths**, but that the actual path **may differ** depending on your environment configuration.
* Remind you to **confirm that each path exists** and to **adjust paths as needed** to match your installation.
I also revised the instructions above the `export PATH` section to improve flow and make it easier to follow. While it’s helpful to provide cut-and-paste examples, it’s equally important that users review each step, as environments can vary.
If you use the above, make sure to fix the indentation from what I posted it. I had to indent the content to prevent GH from rendering the markdown.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1830769891
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
Could there be not suggestions for the different OSs? It is more helpful, if the Guide already takes you to the right place of your SDK.
I overread the part "substitute the path with your local installation". But the example `ANDROID_HOME=/path/to/android-sdk/`would make it more clear
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "GitToTheHub (via GitHub)" <gi...@apache.org>.
GitToTheHub commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1830769891
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
Could there be not suggestions for the different OSs? It is more helpful, if the Guide already takes you to the right place of your SDK.
I overhead the part "substitute the path with your local installation". But the example `ANDROID_HOME=/path/to/android-sdk/`would make it more clear
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] Add ZSH config for setting environment variables on macOS Catalina and newer [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1830487130
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
Review Comment:
```suggestion
On macOS versions prior to Catalina or on Linux, use any text editor to create or modify the `~/.bash_profile` file.
```
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
Review Comment:
```suggestion
On macOS Catalina and newer, create or modify the `~/.zprofile` file instead, as the default shell has changed.
```
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
This section may be unnecessary, as the previous line instructs to "substitute the path with your local installation."
The example path, `/Development/android-sdk/`, as far as I am aware is not a standard or default path, even on Linux. It was only for an example. I believe it was intended to account for users who set up their Android development environment with `cmdline-tools` rather than Android Studio.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu merged PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1830541978
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
Maybe something like this is clearer that it's an example placeholder?
```bash
export ANDROID_HOME=/path/to/android-sdk/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] doc(android): document ZSH setup for macOS Catalina and newer [cordova-docs]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu commented on code in PR #1360:
URL: https://github.com/apache/cordova-docs/pull/1360#discussion_r1831411049
##########
www/docs/en/dev/guide/platforms/android/index.md:
##########
@@ -284,14 +284,21 @@ _**Note:** The directories above are generally located in the Android SDK ROOT._
#### macOS and Linux
-On a Mac or Linux, with a text editor, create or modify the `~/.bash_profile` file.
+On a Mac older then Catalina or on Linux, create or modify the `~/.bash_profile` file for e.g. with a text editor.
+On macOS Catalina and newer, create or modify the `~/.zprofile`, because it's using ZSH instead of Bash.
To set an environment variable, add a line that uses `export` like so (substitute the path with your local installation):
```bash
export ANDROID_HOME=/Development/android-sdk/
```
+on macOS
+
+```zsh
+export ANDROID_HOME=~/Library/Android/sdk/
+```
+
Review Comment:
If we wanted to suggest for different OS, we could update the entire section like this?
```
Add the following line to your shell's profile to set up the `ANDROID_HOME` environment variable.
**macOS:**
```bash
export ANDROID_HOME=~/Library/Android/sdk
```
**Linux:**
```bash
export ANDROID_HOME=~/Android/Sdk
```
The above examples point to the standard paths where the Android SDK is typically stored. Depending on your environment configuration, the path may differ. Be sure to confirm that the path exist or adjust them to match your local installation.
After setting the `ANDROID_HOME` environment variable, update the `PATH` variable to include directories containing various Android-related binaries.
```bash
export PATH=$PATH:$ANDROID_HOME/platform-tools/
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin/
export PATH=$PATH:$ANDROID_HOME/build-tools/
export PATH=$PATH:$ANDROID_HOME/emulator/
```
```
The above:
* Provide example `export` lines for macOS and Linux, pointing to standard paths.
* Mention that these are **standard paths**, but that the actual path **may differ** depending on your environment configuration.
* Remind you to **confirm that each path exists** and to **adjust paths as needed** to match your installation.
I also revised the instructions above the `export PATH` section to improve flow and make it easier to follow. While it’s helpful to provide cut-and-paste examples, it’s equally important that users review each step, as environments can vary.
If you use the above, make sure to fix the indentation from what I posted it. I had to indent the content to prevent GH from rendering the markdown.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org