misc
Clover And a Android Emulator
Setting up a clover emulator
I was tasked with creating an application to assist a company with their point of sale(POS) process. They utilize Clover for their systems. This is perfect as Clover offers a SDK library for their devices and the devices run on Android. The instructions on their page went smooth until the app update failed to install the libraries.
Install All One By One?
In reality I know now that for the task that I was assigned to, I did not need to install all of the applications on the Clover website. But instead of manually installing each I created a quick script that downloaded and installed into an Android Emulator.
PowerShell To The Rescue!
foreach($line in Get-Content .\devices.txt) {
Write-Host $line
Invoke-WebRequest -Uri $line -OutFile $line.split("/")[-1]
}
After parsing the website and pulling the links that ended with an APK extension into a text file it was time to script this. The previous PowerShell script reads each line of text files and invokes a web request to download it.
Batch Install
After the files were downloaded, I created a script that would install the files via ADB. For each APK file that needs to be installed a line was added into a apks.bat file.
adb install [apkFilename]
The previous command invokes the adb application to install the apkFilename on the Android device that is connected to the adb server.