ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
20.92k stars 1.39k forks source link

Could we add the Android SDK Manager #1886

Closed NemoStein closed 6 years ago

NemoStein commented 6 years ago

Now that there is no GUI on Android SDK manager/tools anymore, isn't it ready to be included on scoop?

The official link is at the end of this link: https://developer.android.com/studio/index.html Current version can be downloaded directly from this link: https://dl.google.com/android/repository/sdk-tools-windows-3859397.zip

Calinou commented 6 years ago

I guess this would still have to go into the extras bucket, since the Android SDK license is not open source.

NemoStein commented 6 years ago

Uhn, I think you're completely right! I thought the same a second after opening the issue...

Should this one be closed and reopened there?

r15ch13 commented 6 years ago

I'm on it. Leave it open 😄

r15ch13 commented 6 years ago

Added with https://github.com/lukesampson/scoop-extras/commit/bd4fb62ac1fd083225d947b474f0010ce6099a05

NemoStein commented 6 years ago

Thanks, @r15ch13. May I request another thing? Could it create a ANDROID_HOME env var pointing to the "bin" folder?

NemoStein commented 6 years ago

Oh, another thing that I noticed. After installing a build-tool, the sdkmanager puts everything in the same parent folder, mixing scoop generated folders with sdkmanager generated ones. I think that a better solution is to put the content of the downloaded zip inside a tools folder, keeping the same original folder structure.

This is one of my tests and it's output:

t1 $ cordova run android
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Detected 'avdmanager' command at C:\Users\Nemo\scoop\shims but no 'tools\bin' directory found near.
Try reinstall Android SDK or update your PATH to include valid path to SDK\tools\bin directory.
r15ch13 commented 6 years ago

Yeah, I noticed the tools directory thing. 😀 monitor.bat will still not work because it needs stuff from platform-tools... (which are included in adb.json)

NemoStein commented 6 years ago

Uhn, I haven't tried this one... I always thought that the Android SDK dependency is awkward. Anyway, is this "fixable"?

r15ch13 commented 6 years ago
r15ch13 commented 6 years ago

Should work with https://github.com/lukesampson/scoop-extras/commit/8e72ae8d0c3094defddb83b440f7d86210db5560

Creating a symlink to the adb\current directory works across updates 😁

NemoStein commented 6 years ago

I don't know why, but the sdkmanager is looking for bin folder in the wrong place.

~ $ sdkmanager --update
& : O termo 'C:\Users\Nemo\scoop\shims\..\apps\android-sdk\current\bin\sdkmanager.bat' não é reconhecido como nome de
cmdlet, função, arquivo de script ou programa operável. Verifique a grafia do nome ou, se um caminho tiver sido
incluído, veja se o caminho está correto e tente novamente.
No C:\Users\Nemo\scoop\shims\sdkmanager.ps1:2 caractere:70
+ ... ion.expectingInput) { $input | & $path @args } else { & $path @args }
+                                                             ~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\Nemo\s...\sdkmanager.bat:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

The correct path is C:\Users\Nemo\scoop\shims\..\apps\android-sdk\current\tools\bin\sdkmanager.bat (missing the tools)

EDIT: Now I know why. The first line of the sdkmanager.ps1 is the culprit. The path is wrong there!

$path = join-path "$psscriptroot" "..\apps\android-sdk\current\bin\sdkmanager.bat"

should be

$path = join-path "$psscriptroot" "..\apps\android-sdk\current\tools\bin\sdkmanager.bat"
r15ch13 commented 6 years ago

Added a fix for the env path. But there is another problem. It downloads the emulator to android-sdk\current\emulator which will get moved on scoop update android-sdk. Adding persistence doesn't work because sdkmanager renames it to emulator.backup (this removes the symlink)

NemoStein commented 6 years ago

Many many thanks, @r15ch13! I'll make some more tests in the following days/weeks, but for now, it's working as intended.

ps: The only issue I'm facing currently is the sdkmanager --update locking the tools folder and not being able to update itself, but it's a know issue in Windows version of the Android SDK.

Nurtaz440 commented 2 years ago
+ CategoryInfo          : ObjectNotFound: (android_sdk/platform-tools:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

how can solve this problem

rashil2000 commented 2 years ago

It doesn't look related to Scoop. What are you trying to install?