Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing battery limiter: Command failed: ./applet /bin/sh: ./applet: Bad CPU type in executable #16

Closed
jxnding opened this issue Oct 17, 2022 · 24 comments
Labels
⏱️ waiting Waiting for response

Comments

@jxnding
Copy link

jxnding commented Oct 17, 2022

After installing, on first-time launch, I get 2 errors:

Error installing battery limiter: Command failed: ./applet
/bin/sh: ./applet: Bad CPU type in executable

Battery limiter error: Command failed: PATH=$PATH:/usr/local/bin/battery battery status
/bin/bash: battery: command not found

I'm on Ventura 13.0 beta, installed the dmg battery-1.0.3-arm64.dmg

@jxnding
Copy link
Author

jxnding commented Oct 17, 2022

Same with brew install battery. However the CLI works kinda (I suspect because it compiles from source right?)

However, it's not working very well. Typing "battery status" gives:
touch: /Users/ding/.battery/battery.log: Permission denied

@actuallymentor
Copy link
Owner

This tool is only for M1 macs, I suspect you are on an Intel one :)

@jxnding
Copy link
Author

jxnding commented Oct 19, 2022

No, I am on an M1 Macbook Air.

@actuallymentor
Copy link
Owner

That is very strange, since the error seems to think your processor is not...

What is your model when you click "about mac"?

image

@timcampbell092
Copy link

timcampbell092 commented Oct 19, 2022

***Let me know if this should be its own post - not sure if it's 100% related as my install never gave jxnding's specific error of: Error installing battery limiter: Command failed: ./applet
/bin/sh: ./applet: Bad CPU type in executable

Hi guys - same issue here on my M1 Macbook Air (Monterey 12.6).
Screen Shot 2022-10-19 at 1 02 26 PM
Tried the install two days ago and getting the same errors using the DMG file.
Error after install attempt:
Screen Shot 2022-10-18 at 9 52 15 AM
Although mine is showing up in the "taskbar"(?) (Coming from windows so bear with me)
Screen Shot 2022-10-19 at 1 17 32 PM
Error when trying to change battery charging option.
Screen Shot 2022-10-19 at 1 04 35 PM
New to MacOS on a new Macbook Air.
The MacBook currently has the following apps installed:
DisplayLink Manager
MS Office
Adobe Premiere & Photoshop Elements 2021
Magnet
MS Edge (Still learning Safari!)

@jxnding
Copy link
Author

jxnding commented Oct 20, 2022

image

@jxnding
Copy link
Author

jxnding commented Oct 23, 2022

Cloning the repo, checking out the latest version tag, and building does seem to work. Will report later (at least adds "battery" as a background item)
image

@merlinmah
Copy link

I get the same errors when Installing through brew in Ventura 13.0.1 on an M1 Max; I chalked it up to /usr/local/bin being hardcoded somewhere, instead of the /opt/homebrew prefix that brew uses by default. Installing via the Github shell script controls charging as expected, provided one remembers to use sudo. Thanks for making this!

@actuallymentor
Copy link
Owner

@merlinmah how would that path cause a CPU error?

@Tokarak
Copy link

Tokarak commented Dec 12, 2022

It's not a cpu error, its a path error. Github search reveals all the hardcoded /usr/local/bin/battery.
https://github.com/actuallymentor/battery/search?q=%2Fusr%2Flocal%2Fbin%2Fbattery

It's best to rely on PATH to find an excecutable.
EDIT: This is issue must have already been fixed, but there has been a regression introduced in one of the recent PRs merged. The code showing up in search has been merged recently.

@actuallymentor
Copy link
Owner

@Tokarak thanks for pointing that out. I think I fixed that path issue just now. Can you confirm it was fixed?

@actuallymentor actuallymentor added the ⏱️ waiting Waiting for response label Dec 17, 2022
@phewitt
Copy link

phewitt commented Dec 22, 2022

looks like it fixed it for me. however the brew package and dmg still need a to include it. I had to clone the repo and run ./setup.sh then install the GUI

@whiterock
Copy link

yeah the brew formulae need updating.

@actuallymentor
Copy link
Owner

@phewitt that is weird because the brew dmg clones the repo using the latest version...

@K-J-E
Copy link

K-J-E commented Jan 20, 2023

hi, I am having this same error (installed through dmg on release page) and the command line commands do not work, so I am unable to use 'battery uninstall'. How could I uninstall the tool? thanks

@actuallymentor
Copy link
Owner

@K-J-E you can manually delete the files

@actuallymentor
Copy link
Owner

I just pushed a update that should fix a few issues, could you try to run brew reinstall --cask battery and see if that fixes it?

@actuallymentor
Copy link
Owner

Could you try the following things to help me debug:

Debug trail 1: installing CLI only

Instead of installing through brew, can you install through these CLI instructions and show me your terminal output?

Debug trail 2: running the app locally

Can you try:

git clone git@github.com:actuallymentor/battery.git
cd battery/app
npm i
npm start

And show me what happens?

@KarstenS123
Copy link

KarstenS123 commented Feb 10, 2023

I think my issue is the same in this issue report. If not, I can open a new one.

I tried just right now to install the app by using the battery-1.0.7-arm64.dmg file downloaded from the releases page.

My Mac is:

Bildschirm­foto 2023-02-10 um 22 33 51

After enter the password for the "Updates" I get these error messages in this order:

Bildschirm­foto 2023-02-10 um 22 31 48

Bildschirm­foto 2023-02-10 um 22 32 05

Bildschirm­foto 2023-02-10 um 22 32 19

Bildschirm­foto 2023-02-10 um 22 32 31

The battery icon is in the menu bar, but nothing happens when I click on it.

@Fiskheimer
Copy link

Fiskheimer commented Feb 11, 2023

I tried just right now to install the app by using the battery-1.0.7-arm64.dmg file downloaded from the releases page.

The battery icon is in the menu bar, but nothing happens when I click on it.

I get the same error messages and behavior on my MacBook Air M2.

@markspercyspencer
Copy link

I have the exact same error messages when trying to install Battery.dmg on my M1 MacBook Air.
Screenshot 2023-02-12 at 02 00 23
Screenshot 2023-02-12 at 02 00 27
Screenshot 2023-02-12 at 02 00 31
Screenshot 2023-02-12 at 02 00 34
Screenshot 2023-02-12 at 02 05 34

@actuallymentor
Copy link
Owner

I believe we found the issue in #48!

Can someone (@jxnding?) with this issue please install this v1.0.8 pre-release and let me known if that solves the issue?

@aresYio
Copy link

aresYio commented Feb 13, 2023

It doesn't work, even with the 1.08 version

@michkz
Copy link

michkz commented Mar 22, 2024

I am also experiencing the same error: "error installing battery limited: undefined” after installing through brew. Im currently on the latest release (v1.2.1). The CLI installation does successfully install the application, but the commands “battery maintain 80” and “battery charging off” do not seem to show the expected visual effect on the battery icon. Also running on a M1 mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⏱️ waiting Waiting for response
Projects
None yet
Development

No branches or pull requests