Code Monkey home page Code Monkey logo

iphonecontroller's Introduction

Hi there ๐Ÿ‘‹

I'm versx, I like to code.

Metrics

GitHub Streak
versx's wakatime stats

Languages:
My Languages

Skills:
My Skills

Internet of Things:
My Languages

Integrated Development Environments:
My Skills

Storage:
My Skills

Current Main Project:
ChuckDeviceController

iphonecontroller's People

Contributors

hunch-13 avatar kamieniarz avatar sabregreen avatar versx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

iphonecontroller's Issues

./dotnet-install.sh --channel 2.1

may want to adjust instructions to say ./dotnet-install.sh --channel 2.1 otherwise you get latest and it likely won't work with 3.x or future versions

Latest tag fails in reboot loop upon receiving a request

Pulled latest master & built, upon launch it does this over and over. Reverted to last tag for now.

0|iPhoneController | 10:39 [TRACE] [HTTP] Initialize
0|iPhoneController | 10:39 [TRACE] [BOT] Start
0|iPhoneController | 10:39 [INFO] [BOT] Connecting to Discord...
0|iPhoneController | [2021-04-13 10:39:43 -07:00] [DSharpPlus] [Info] DSharpPlus, version 3.2.3
0|iPhoneController | [DSharpPlus] DSharpPlus, version 3.2.3: DSharpPlus, version 3.2.3
0|iPhoneController | 10:39 [TRACE] [HTTP] Start
0|iPhoneController | 10:39 [INFO] [HTTP] Starting...
0|iPhoneController | 10:39 [INFO] [HTTP] Started
0|iPhoneController | 10:39 [DEBUG] [HTTP] Listening on port 6542...
0|iPhoneController | 10:39 [INFO] [HTTP] Starting HttpServer request handler...
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Connected.
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Current Application:
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Name: iPhoneController
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Description:
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Owner: SenorKarlos#9419
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Current User:
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Id: redacted
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Name: redacted
0|iPhoneController | 10:39 [INFO] [BOT] [DISCORD] Email:
0|iPhoneController | 10:39 [INFO] [BOT] Machine Name: MacOS
0|iPhoneController | 10:40 [INFO] [HTTP] Handling restart request for device A11-SE-a89b...
0|iPhoneController | 10:40 [DEBUG] [BOT] Unhandled exception caught.
0|iPhoneController | 10:40 [ERROR] [BOT] System.NullReferenceException: Object reference not set to an instance of an object.
0|iPhoneController | at CallSite.Target(Closure , CallSite , Dictionary`2 , Object )
0|iPhoneController | at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
0|iPhoneController | at iPhoneController.Net.HttpServer.HandleDeviceRequest(WebhookPayload payload) in /Users/senorkarlos/iPhoneController/src/Net/HttpServer.cs:line 198
0|iPhoneController | at iPhoneController.Net.HttpServer.RequestHandler() in /Users/senorkarlos/iPhoneController/src/Net/HttpServer.cs:line 161
0|iPhoneController | at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
0|iPhoneController | --- End of stack trace from previous location where exception was thrown ---
0|iPhoneController | at System.Threading.ThreadPoolWorkQueue.Dispatch()
0|iPhoneController | Unhandled Exception:
0|iPhoneController | System.NullReferenceException: Object reference not set to an instance of an object.
0|iPhoneController | at CallSite.Target(Closure , CallSite , Dictionary`2 , Object )
0|iPhoneController | at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
0|iPhoneController | at iPhoneController.Net.HttpServer.HandleDeviceRequest(WebhookPayload payload) in /Users/senorkarlos/iPhoneController/src/Net/HttpServer.cs:line 198
0|iPhoneController | at iPhoneController.Net.HttpServer.RequestHandler() in /Users/senorkarlos/iPhoneController/src/Net/HttpServer.cs:line 161
0|iPhoneController | at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
0|iPhoneController | --- End of stack trace from previous location where exception was thrown ---
0|iPhoneController | at System.Threading.ThreadPoolWorkQueue.Dispatch()
0|iPhoneController | 10:40 [TRACE] [BOT] WhConfig [OwnerId=2redacted, GuildId=redacted, ChannelIds=redacted]

Iphone controller doest reboot when RDMmonitor sents reboot command

When RDMmonitor encounters a device that is stuck, it sents a reboot command to a remote listener, in my case iphonecontroller.
However it never gets accepted, even though the 2 programs are local and port 6542 is open.
There is no error in rdmmonitor just that it sents the reboot command and also no error in the logs of iphonecontroller, it just doestn receive it it seem.

Config for rdmmonitor


"allowWarnReboots": true,
"rebootMonitorURL": ["http://127.0.0.1:6542"],
"sendRebootAlerts": true,
"excludeFromReboots": ["Device01","Device02"],


config part of iphonecontroler


"host": "127.0.0.1",
"port": 6542,

[Bug] Can't kill usbmuxd

Since the usbmuxd process is ran by the _usbmuxd user account the readme example for kill usbmuxd won't work.

Three routes I can see:

  1. You add sudo to the PhoneController.cs and tell users how to modify their /etc/sudoers file to allow password less process restarts.
    YOUR_COMPUTER_USERNAME ALL=(ALL)  /sbin/reboot,/usr/bin/killall
    
  2. Just remove the kill usbmuxd example from the readme (my personal favorite)
  3. Use a LaunchDaemon with a watch file path that kills the usbmuxd process. You would need to modify the phone controller to touch a file like touch /private/tmp/.restart_usbmuxd. Also users would need to script or cp the launch daemon to the correct location and start the service with launchctl

I can provide more details if you are interested in option 3. I have no real stake in this since I don't use this feature.

SAM option failure

sam option always seems to fail with Failed to get ECID for device XXX (uuid does display here) to reapply SAM profile

this is with useIosDeploy = true

SAM start/stop

As part of #4 @kamieniarz thinks it would be cool for if you supported starting/stopping SAM. If you install Apple Configurator there is a separate ID that is used to target specific devices. This isn't the uuid used with other tools so you'll have to parse the output from cfgutil list(?)

Can upload the profile when not on mobile or you can search for the following text in one of our mutual servers.

cfgutil -v remove-profile com.apple.configurator.singleappmode
cfgutil -v install-profile ~/Desktop/sam_pogo.mobileconfig

This requires Apple Configurator 2 to be installed
If anyone wants to wrap that into their internal tooling. Might make setup for new iphones easier. Could also be used as a potential fix for the "Guided access not available" popup shit that doesn't require a reboot.

Provided as is. I'm not support. Just sharing to help the community

Install results in exit code 1 and a dumb message about touching the device but it still works. Apple bugs ๐Ÿคทโ€โ™‚๏ธ

Still doesn't help with system pop ups but those are mostly triggered due to a reboot over here ๐Ÿคทโ€โ™‚๏ธ

iPhone Contreoller Error

Fresh clean install, iPhoneController runs but upon missing any command I get an error

[iPhoneController] Magik tried executing 'screen' but it errored: System.ComponentModel.Win32Exception: No such file or directory: Magik tried executing 'screen' but it errored: System.ComponentModel.Win32Exception: No such file or directory
7:37 PM [ERROR] [BOT] User Magik tried executing command screen and unknown error occurred.
: System.ComponentModel.Win32Exception (2): No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at iPhoneController.Utils.Shell.Execute(String cmd, String args, Int32& exitCode, Boolean includeErrorOutput) in /Users/pokemon/iPhoneController2/src/Utils/Shell.cs:line 50
   at iPhoneController.Models.Device.GetDevicesCfgUtil() in /Users/pokemon/iPhoneController2/src/Models/Device.cs:line 240
   at iPhoneController.Models.Device.GetAll() in /Users/pokemon/iPhoneController2/src/Models/Device.cs:line 102
   at iPhoneController.Commands.PhoneControl.ScreenshotAsync(CommandContext ctx, String phoneNames) in /Users/pokemon/iPhoneController2/src/Commands/PhoneControl.cs:line 100
   at DSharpPlus.CommandsNext.Command.ExecuteAsync(CommandContext ctx)```

force the use of "all" in command rather than assume all

When issuing the command screen or reboot if you do not add a device ID at the end, it currently assumes "all"
A change request to force the use of "all" to screen or reboot all rather than assume If there is no device stated.

Currently reboot will reboot all devices
Change too reboot all to reboot all devices

If no device ID is added it is ignored

Will not handle reopen requests due to find IP failing

Using tag 1.2.1 as latest fails in a crash loop (next issue) but for as long as I can remember, iPC will not find device IP's. They are using WiFi for internet and USB for mac connection. I can take screenshots and handle reboots but not this.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.