airsdk / apm

AIR Package Manager
https://repository.airsdk.dev/
MIT License
60 stars 10 forks source link

apm installation #100

Closed Shaunmax closed 2 years ago

Shaunmax commented 2 years ago

I completed all the steps required for apm, but when I run apm -version i get zsh: command not found: apm

what could be wrong? image

image

marchbold commented 2 years ago

Something doesn't look right there, you are missing the apm script from that folder. Maybe try downloading the latest version again?

Shaunmax commented 2 years ago

Something doesn't look right there, you are missing the apm script from that folder. Maybe try downloading the latest version again? same result : -

image

also I am getting this : - zsh: permission denied: apm

when running with sudo apm -version i get this : - sudo: apm: command not found

marchbold commented 2 years ago

You may have to adjust the permissions on the script.

chmod +x $AIR_TOOLS/apm
Shaunmax commented 2 years ago

You may have to adjust the permissions on the script.

chmod +x $AIR_TOOLS/apm

Ok! that worked but I am getting this, is it ok ?

% apm -version
1.1.2
io error:[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 127.0.0.1" errorID=2031]
marchbold commented 2 years ago

Hmmm shouldn't get an error just running that.

Can you run it like this :

apm -l d version
Shaunmax commented 2 years ago

apm -l d version

D::RunConfig::loadEnvironment()
D::LoadMacOSEnvironmentVariablesProcess::start()
io error:[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 127.0.0.1" errorID=2031]
D::LoadMacOSEnvironmentVariablesProcess::Process exited with: 0
D::LoadMacOSJavaHomeProcess::start()
D::LoadProjectDefinitionProcess::start()
D::LoadUserSettingsProcess::start()
D::LoadUserSettingsProcess::User settings file doesn't exist
apm: v1.1.2
marchbold commented 2 years ago

Very odd, do you have an active network connection on that machine. I feel like that's an error from the AIR SDK as there are no sockets used in apm

marchbold commented 2 years ago

Which version of the AIR SDK are you using?

Shaunmax commented 2 years ago

The latest one AIR 33.1.1.713

On Thu, Dec 16, 2021, 06:20 Michael @.***> wrote:

Which version of the AIR SDK are you using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/airsdk/apm/issues/100#issuecomment-995336881, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6PAMQ6QEUOJMDW6DNRG23UREZTRANCNFSM5KC3FZYA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

marchbold commented 2 years ago

That error must be coming from AIR or adl directly. There is nothing in apm that should be producing this error message.

@ajwfrost Do you have any ideas where a random message like this would come from?

marchbold commented 2 years ago

@Shaunmax Is the client working apart from that message? eg can you run a search for a package

apm search IDFA
Shaunmax commented 2 years ago

apm search IDFA

~ % apm search IDFA
io error:[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 127.0.0.1" errorID=2031]
✓ Search complete              
found [1] matching package(s) for search 'IDFA'
└──com.distriqt.IDFA@5.0.31   The IDFA extension gives you simple access to the advertising identifiers on Android and iOS.
marchbold commented 2 years ago

Weird, so it's working fine, just some weird error message. Might have to wait for a comment from Andrew...

ajwfrost commented 2 years ago

Sounds odd, the only thing I can think of is if it's trying to connect to a debugger or similar, but then failing ..

Can you please run the below and see whether there's anything listening on ports 7934 or 7936 or similar?

lsof -i -P | grep -i "listen"

Plus also worth maybe editing the 'apm' file and where it's got "${ADL_DIR}"adl -profile extendedDesktop -cmd ..., add the -nodebug option i.e.

"${ADL_DIR}"adl -profile extendedDesktop -nodebug -cmd "${SCRIPT_DIR}/apm.xml" -- \

as that would stop it trying to connect to a debugger.

thanks

Shaunmax commented 2 years ago

lsof -i -P | grep -i "listen"

~ % lsof -i -P | grep -i "listen" HP\x20Dev 583 mymacname 8u IPv4 0xb4e68cbe31029b4d 0t0 TCP localhost:50114 (LISTEN) HP\x20Dev 583 mymacname 9u IPv4 0xb4e68cbe31029b4d 0t0 TCP localhost:50114 (LISTEN) HP\x20Dev 583 mymacname 10u IPv4 0xb4e68cbe31029b4d 0t0 TCP localhost:50114 (LISTEN) idea 820 mymacname 14u IPv6 0xb4e68cbe30e05e9d 0t0 TCP localhost:63342 (LISTEN) idea 820 mymacname 33u IPv6 0xb4e68cbe30e07d3d 0t0 TCP localhost:6942 (LISTEN) idea 820 mymacname 66u IPv6 0xb4e68cbe2e97297d 0t0 TCP localhost:49632 (LISTEN) adb 2161 mymacname 12u IPv4 0xb4e68cbe31027dad 0t0 TCP localhost:5037 (LISTEN)

Shaunmax commented 2 years ago

"${ADL_DIR}"adl -profile extendedDesktop -nodebug -cmd "${SCRIPT_DIR}/apm.xml" -- \

@echo off
chcp 65001>nul
::set WORKING_DIR=%cd%
::set SCRIPT_DIR=%~dp0
::set AIRDIR=%AIR_HOME%

for /f "tokens=*" %%a in ('where adl.exe') do set ADL_DIR=%%a
for %%a in (%ADL_DIR%) do set AIR_BIN_DIR=%%~dpa
for %%a in (%AIR_BIN_DIR:~0,-1%) do set AIR_DIR=%%~dpa

adl -profile extendedDesktop -nodebug -cmd "%~dp0\apm.xml" -- -workingdir "%cd%" -airdir "%AIR_DIR% " -uname "windows" %*

this is how it currently looks, which line should i edit?

ajwfrost commented 2 years ago

Okay thanks. Very strange then, so it doesn't sound like it's trying to connect to a debugger (you already have '-nodebug' in there, thanks @marchbold I hadn't spotted you'd added to macos too...). The only other connection that the runtime itself would try to make is to Scout in case you have a ~/.telemetry.cfg file present on your machine... but normally that would be removed if Scout isn't running (and if it was running you'd see it in that list of processes...)

Do you see the same problem if you first close down IntelliJ IDEA?

Also - what version of macOS are you running, we can see if we can reproduce it here..

Shaunmax commented 2 years ago

Also - what version of macOS are you running, we can see if we can reproduce it here..

image

Do you see the same problem if you first close down IntelliJ IDEA?

yes

The only other connection that the runtime itself would try to make is to Scout

Scout wont work on Catalina

marchbold commented 2 years ago

Thats the windows bat file not the macos script.

I don't believe we have nodebug flag on the macos script as that was added to solve the delay issue on windows, is it needed on macos as well?

Shaunmax commented 2 years ago

Thats the windows bat file not the macos script.

oops! is there any other file for apm?

ajwfrost commented 2 years ago

Ah good spot ... there's less of a problem with it on macos of course, but it may optimise things a little if we have '-nodebug'. Mostly though I was just trying to ensure the runtime didn't try to connect a socket up to the fdb process..

ajwfrost commented 2 years ago

Sorry, just seen this: > Scout wont work on Catalina

Really? I'm sure I have it working on Big Sur...?

Shaunmax commented 2 years ago

Ok! I missed that update! my bad! Yes, its working now, but has some issue with certificate!

marchbold commented 2 years ago

Right, so this message was AIR trying to connect to a debugger? I'll get -nodebug add to the script for the next release.

ajwfrost commented 2 years ago

@marchbold not sure if that is the case. If @Shaunmax is able to update the command line in the "apm" script (rather than "adm.bat") then we could confirm it. But may be good to do anyway :-)

But I am really unclear as to why any internal socket connection failure would end up with some output of an IOError on the command-line. Plus, I can't find the text "io error" anywhere in the AIR source code...! IOError is used in the APM for stuff around system i/o and nativeprocess I believe, could that be failing somewhere? (Although, they shouldn't be coming out with a socket error, the only place I can find that is in the AS3 Socket class itself...)

Weird one...

@Shaunmax just wondering, actually, rather than changing the script to add -nodebug, can you instead open another terminal, go to the AIR SDK "bin" folder, and run ./fdb - and then enter the command run. It should say Waiting for Player to connect and then if you run the APM, (a) if it was about the lack of a debugger, it should now connect and therefore no longer output that IOError; or (b) if it wasn't about the debugger, then the fact that there is a debugger (and hopefully it connects) means that the output message will then be populated with more information including the call stack...

thanks

marchbold commented 2 years ago

Yeah, there are obviously io operations in apm (writing and reading from disk) but nothing to do with sockets.

And with the particular apm -version command initially showing the error it basically prints a string and then exits . Which is why I tagged you as I really can't see how it could be the apm.swf?

Shaunmax commented 2 years ago

can you instead open another terminal, go to the AIR SDK "bin" folder, and run ./fdb - and then enter the command run. this is what i got : -

bin % ./fdb
Adobe fdb (Flash Player Debugger) [build development]
Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
(fdb) run
Waiting for Player to connect
apm -version
Failed to connect; session timed out.
Ensure that:
1. you compiled your Flash movie with debugging on, and
2. you are running the Debugger version of the Flash Player.
(fdb) Unknown command 'apm', ignoring it
(fdb) 
ajwfrost commented 2 years ago

Just to confirm, you need to run ./fdb in one terminal and get it to say "Waiting for Player to connect"; then go back to another terminal to run the apm -version in parallel...

Shaunmax commented 2 years ago

run the apm -version in parallel...

terminal 1

 bin % ./fdb
Adobe fdb (Flash Player Debugger) [build development]
Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
(fdb) run
Waiting for Player to connect
Player connected; session starting.
Set breakpoints and then type 'continue' to resume the session.
[SWF] Users:mymacname:Library:Application Support:JetBrains:IntelliJIdea2021.2:plugins:ASProfiler:lib:profiler_agent_10.swf - 9,669 bytes after decompression
(fdb) continue
[SWF] apm.swf - 208,925 bytes after decompression
[UnloadSWF] apm.swf
Player session terminated
(fdb) 

terminal 2

% apm -version
1.1.2
io error:[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 127.0.0.1" errorID=2031]

only after entering continuein terminal 1, terminal 2 responded with version number and the error.

ajwfrost commented 2 years ago

Okay thanks ... so actually that didn't give the call stack information that I was hoping for :-( But curious as to what this is: [SWF] Users:mymacname:Library:Application Support:JetBrains:IntelliJIdea2021.2:plugins:ASProfiler:lib:profiler_agent_10.swf - 9,669 bytes after decompression

Are you able to run without IntelliJ running, or do you know what this SWF is doing? My guess would be this is the culprit but I don't know how/why it would be loading...?

Shaunmax commented 2 years ago

Are you able to run without IntelliJ running, or do you know what this SWF is doing? My guess would be this is the culprit but I don't know how/why it would be loading...?

Yes, but the result is same!

A quick search, tells me that its something used by IntelliJIdea : -

image