View Single Post
Old 06-10-2023, 09:08 PM   #362
DuckieTigger
Wizard
DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.DuckieTigger ought to be getting tired of karma fortunes by now.
 
DuckieTigger's Avatar
 
Posts: 4,763
Karma: 246906703
Join Date: Dec 2011
Location: USA
Device: Oasis 3, Oasis 2, PW3, PW1, KT
Quote:
Originally Posted by Montana Harper View Post
Even with the connection enabled and/or using the shortcut, the port still changes. Possibly it's the version of BS (5.11) I'm using? It doesn't matter if it's Nougat or Pie, though; I've tried both of them. I can't disable the various Win10 Pro VM features (Hyper-V, etc.) without breaking other necessary programs, or I'd be using BS 5.09 and BSTweaker.

Ah, well. I guess it'll just be a multi-step process for me each time. Thanks for helping me troubleshoot!
Solution to make it automatic, even with Hyper-V enabled. Simply run this batch file from the directory you want the "files" folder created. You have to verify that the BS config file is in the location indicated, BS open, and ADB option enabled before running the batch file. If installed in the C:\ drive, it should be where I set it. The instance will change. I have multiple Nougat64 machines from BS, so my personal machine is called "Nougat64_5" and not "Nougat64" as indicated in the batch file below. To find the name of the instance, look in the shortcut on desktop you can create in multi instance manager. Mine has the target: "C:\Program Files\BlueStacks_nxt\HD-Player.exe" --instance Nougat64_5. So I would need to change Nougat64 to Nougat64_5. It assumes that there is a path variable set for ADB. Either set one, or edit the batch file to add the location in front of it. Edit the red parts in the code.

Code:
@ECHO OFF
CLS
REM Extracting all books from a Bluestacks instance with unknown port
REM Edit the following SET commands with your own file location and
REM BlueStacks instance name

SET BS_config_file=C:\ProgramData\Bluestacks_nxt\bluestacks.conf
SET BS_instance=Nougat64


FOR /F "tokens=2 delims==" %%F IN ('findstr ".%BS_instance%.status.adb_port=" %BS_config_file%') DO SET ADB_PORT=%%F
adb connect localhost:%ADB_PORT%
adb -s localhost:%ADB_PORT% -a pull /sdcard/Android/data/com.amazon.kindle/files
adb disconnect localhost:%ADB_PORT%
@ECHO ON
@PAUSE

Last edited by DuckieTigger; 06-12-2023 at 10:41 PM. Reason: Fixed bug
DuckieTigger is offline   Reply With Quote