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
ideviceinfo com.apple.mobile.battery over WiFi - sometimes works? #947
Comments
The wifi connection is not permanent. It only works when the device wakes up every now and then. |
You're right Nikias but the wait is at most a couple minutes in my case so it isn't bad. Thanks for all you do! Do you think it'll ever be possible to read Apple Watch's battery level through ideviceinfo? Maybe battery level can go from Watch → iPhone → Custom Bonjour (?) Sync Service → ideviceinfo / mac. Would this be possible? |
@JCsplash for Apple watch we need to go through companion proxy. I think this is possible. |
@nikias Would you mind elaborating a bit? Would this approach require an apple watch app and/or iPhone app? Right now I plan to do it the brute force way :(
If somehow we could achieve Apple Watch → Mac directly that’d be huge. But not sure what exactly you’re thinking of. |
I will post an addition to the library in the upcoming days and then you implement it for your needs. No need for an app. Just stay put. |
Thank you @nikias! I just finished the app above which works but is overkill and slow (watch connectivity only gives me at most 2 updates an hr). I can’t wait to try your solution. I'm already using ideviceinfo to get ipad / iphone charge so this would be perfect. If you’d be down to share your thought process along the way, I’d really appreciate that as well! |
Also @nikias I found the code below that tries this com.apple.companion_proxy approach. https://gist.github.com/matteyeux/04df80e5368d99a001b7 Maybe this could help? |
@JCsplash check my latest commit 0268777 and this: |
@nikias thank you for making this, it looks great! I’m not exactly sure how i can use it though. Would you mind sharing some more instructions? Is there a command i can call like ideviceinfo? |
@JCsplash compile and run my test program |
@nikias I'm getting " error: no matching function for call to 'idevice_new_with_options'". I pretty sure i have the latest code. Any thoughts on what to do here? |
You must have an older version installed somewhere. |
EDIT: Ended up doing the following which was able to compile comptest.
I'm running into this error now. Are you able to successfully compile/link by just doing "gcc comptest.c"? I checked that i do have companion_proxy.h installed in the latest version. But somehow comptest is not recognizing its methods. |
This works amazing! Thank you so much @nikias ! Is there any way to make it run a bit faster like idevice_id or ideviceinfo? Right now it takes about 3-4s. Here's what I did to get it working (if anyone else needs help) Compiling Code
Move executable to /usr/local/bin so it can be used globally (Optional) Running Code
|
It doesn't run faster, this is how Apple implemented it unfortunately. Like every time you query a key it closes the connection from the device side... |
No worries, this is great. Do you know if apple pencil also uses companion_proxy to connect to iPad or if that's just for watches? |
Just watches. Appel Pencil uses Bluetooth LE. |
@nikias Sounds good. What do you think about adding a timeout to comptest? Do you think it's necessary? |
Do whatever you want with it, it's just a proof of concept. |
Sounds good. Thank you so much @nikias ! |
Hey @nikias is there a "BatteryIsCharging" or "ExternalChargeCapable" value for Apple Watch? I tried using get_value_from_watch but just got back "Unexpected error occurred". I'm wondering if those fields even exist? |
|
Also please update libplist again, I had a name mismatch between header file and public interface function. |
@nikias Did you push your libplist changes? I still see "bbde6a4" as the last libplist commit made 6 days ago? |
my bad, now I did |
Just updated libplist, compiled, and |
Hey @nikias , quick question. Do you know if WiFi networks can have WiFi sync disabled by their administrators? I realized WiFi sync works on my WPA2 Personal Network but not on the WPA2 Enterprise network at my school. Is this typical? |
Maybe the admins are dropping certain packet types. WiFi sync uses mDNS for device discovery. |
It seems like ideviceinfo -u DID -q com.apple.mobile.battery over WiFi (with iTunes WiFi Sync turned on without usb connection - sometimes works).
Is this considered normal?
The text was updated successfully, but these errors were encountered: