[GH-ISSUE #1276] Android emulator scripts (install_certificate_android_emulator.sh) not working with all configurations #1271

Open
opened 2026-03-03 19:49:55 +03:00 by kerem · 8 comments
Owner

Originally created by @jeanetienne on GitHub (Jun 29, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1276

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version? (Ex. Proxyman 1.4.3)

3.6.0

macOS Version? (Ex. mac 10.14)

12.4

Steps to reproduce

  1. Use fish shell as default shell in Terminal.app
  2. Install Proxyman.app in ~/Applications (instead of /Applications)
  3. Go to menu "Certificate" → "Install Certificate on Android" → "Emulators…"
  4. Use the "Override emulator" or "Reset override" scripts

Expected behaviour

The scripts are run.

Actual behaviour

The scripts are not run.

Potential explanations
  • Perhaps because the command sent by the app is hardcoded to /Applications/Proxyman.app/… and there is no script at this path?
  • Perhaps because the command sent by the app is expecting a different shell?

Screenshots (optional)

n/a

Originally created by @jeanetienne on GitHub (Jun 29, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1276 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version? (Ex. Proxyman 1.4.3) 3.6.0 ### macOS Version? (Ex. mac 10.14) 12.4 ### Steps to reproduce 1. Use `fish` shell as default shell in Terminal.app 2. Install Proxyman.app in `~/Applications` (instead of `/Applications`) 3. Go to menu "Certificate" → "Install Certificate on Android" → "Emulators…" 4. Use the "Override emulator" or "Reset override" scripts ### Expected behaviour The scripts are run. ### Actual behaviour The scripts are not run. ##### Potential explanations - Perhaps because the command sent by the app is hardcoded to `/Applications/Proxyman.app/…` and there is no script at this path? - Perhaps because the command sent by the app is expecting a different shell? ### Screenshots (optional) n/a
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 29, 2022):

Can you share the error log or something that I can trace back?

I double-check the code:

  1. It works fine for both ~/Applications or /Applications because Proxyman gets the relative path, not hardcode.
  2. To execute the script, Proxyman leverage the AppScript:
do script "bash \(path) all \(ip) \(port) \(certPath)"

By default, it will open the Terminal and load all $PATH.

<!-- gh-comment-id:1169489146 --> @NghiaTranUIT commented on GitHub (Jun 29, 2022): Can you share the error log or something that I can trace back? I double-check the code: 1. It works fine for both `~/Applications` or `/Applications` because Proxyman gets the relative path, not hardcode. 2. To execute the script, Proxyman leverage the AppScript: ``` do script "bash \(path) all \(ip) \(port) \(certPath)" ``` By default, it will open the Terminal and load all $PATH.
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 29, 2022):

You might open the Terminal and execute the following code:

bash ~/Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all 192.168.0.1 9090 ~/.proxyman/proxyman-ca.pem
<!-- gh-comment-id:1169489911 --> @NghiaTranUIT commented on GitHub (Jun 29, 2022): You might open the Terminal and execute the following code: ```bash bash ~/Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all 192.168.0.1 9090 ~/.proxyman/proxyman-ca.pem ```
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 29, 2022):

One noted:

Proxyman requires Automation Permission in order to execute the automation script by AppleScript. Please consider granting Proxyman app in System Preference -> Security & Privacy -> Privacy -> Automation -> Allow Proxyman app.

<!-- gh-comment-id:1169490236 --> @NghiaTranUIT commented on GitHub (Jun 29, 2022): One noted: > Proxyman requires Automation Permission in order to execute the automation script by [AppleScript](https://developer.apple.com/documentation/foundation/nsapplescript). Please consider granting Proxyman app in System Preference -> Security & Privacy -> Privacy -> Automation -> Allow Proxyman app.
Author
Owner

@jeanetienne commented on GitHub (Jun 30, 2022):

Thanks for your quick and detailed response @NghiaTranUIT !

I have Automation permission enabled for Proxyman (see screenshot below).
I also managed to make it work by running the command manually.
However when I click on the "Override emulator" or "Reset override" button, it opens a new Terminal window, but nothing happens in it.

What error log would you like to see? Where should I get such log?

Thanks!

Screen Shot

<!-- gh-comment-id:1170638996 --> @jeanetienne commented on GitHub (Jun 30, 2022): Thanks for your quick and detailed response @NghiaTranUIT ! I have Automation permission enabled for Proxyman (see screenshot below). I also managed to make it work by running the command manually. However when I click on the "Override emulator" or "Reset override" button, it opens a new Terminal window, but nothing happens in it. What error log would you like to see? Where should I get such log? Thanks! ![Screen Shot](https://user-images.githubusercontent.com/1822562/176569586-09ad046e-4944-43f0-9800-3dacde3ff85a.png)
Author
Owner

@jeanetienne commented on GitHub (Jun 30, 2022):

Perhaps this helps? A screen recording of what happens (or doesn't happen 😅).

I also attached the Console.app logs that you can see in the screen recording.

https://user-images.githubusercontent.com/1822562/176571510-cc90a007-78bd-49c7-8a3c-77a37397cf2a.mov

console.txt


Don't stress too much, it's not a pressing issue for me. I can run the scripts manually 👍

<!-- gh-comment-id:1170644210 --> @jeanetienne commented on GitHub (Jun 30, 2022): Perhaps this helps? A screen recording of what happens (or doesn't happen 😅). I also attached the Console.app logs that you can see in the screen recording. https://user-images.githubusercontent.com/1822562/176571510-cc90a007-78bd-49c7-8a3c-77a37397cf2a.mov [console.txt](https://github.com/ProxymanApp/Proxyman/files/9015581/console.txt) --- Don't stress too much, it's not a pressing issue for me. I can run the scripts manually 👍
Author
Owner

@NghiaTranUIT commented on GitHub (Jun 30, 2022):

Not sure if this beta build can fix the bug: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.6.0_Try_fixing_the_AppleScript.dmg

Basically, I change AppleScript when executing the bash script.


If the beta build doesn't work, please open the Script Editor app -> try to run this code: I'd like to see the output.

if application "Terminal" is running then
	tell application "Terminal"
		do script "bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all 192.168.0.1 9090 ~/.proxyman/proxyman-ca.pem"
		activate
	end tell
else
	tell application "Terminal"
		do script "bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all 192.168.0.1 9090 ~/.proxyman/proxyman-ca.pem" in window 1
		activate
	end tell
end if
<!-- gh-comment-id:1170676879 --> @NghiaTranUIT commented on GitHub (Jun 30, 2022): Not sure if this beta build can fix the bug: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.6.0_Try_fixing_the_AppleScript.dmg Basically, I change AppleScript when executing the bash script. -------- If the beta build doesn't work, please open the Script Editor app -> try to run this code: I'd like to see the output. ```applescript if application "Terminal" is running then tell application "Terminal" do script "bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all 192.168.0.1 9090 ~/.proxyman/proxyman-ca.pem" activate end tell else tell application "Terminal" do script "bash /Applications/Proxyman.app/Contents/Frameworks/ProxymanCore.framework/Resources/install_certificate_android_emulator.sh all 192.168.0.1 9090 ~/.proxyman/proxyman-ca.pem" in window 1 activate end tell end if ```
Author
Owner

@jeanetienne commented on GitHub (Aug 4, 2022):

Hey, sorry for the lengthy response time!

Here's a screen grab of when I execute the above script (adapted to my local values), in my terminal (using fish):

https://user-images.githubusercontent.com/1822562/182787572-c566fd0c-5117-405c-944e-b32f86fdc775.mov

Interestingly, if I change my shell to revert back to the default login shell (I usually use fish shell), then it looks like this.
Screen Shot 2022-08-04 at 17 17 30

https://user-images.githubusercontent.com/1822562/182788136-56121a7b-f59c-42cc-95ae-995b8682e778.mov

<!-- gh-comment-id:1204867672 --> @jeanetienne commented on GitHub (Aug 4, 2022): Hey, sorry for the lengthy response time! Here's a screen grab of when I execute the above script (adapted to my local values), in my terminal (using fish): https://user-images.githubusercontent.com/1822562/182787572-c566fd0c-5117-405c-944e-b32f86fdc775.mov Interestingly, if I change my shell to revert back to the default login shell (I usually use `fish` shell), then it looks like this. <img width="667" alt="Screen Shot 2022-08-04 at 17 17 30" src="https://user-images.githubusercontent.com/1822562/182787905-97d37b93-6143-4a01-a6f1-570494a6cc63.png"> https://user-images.githubusercontent.com/1822562/182788136-56121a7b-f59c-42cc-95ae-995b8682e778.mov
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 4, 2024):

Thanks. Selecting Default Login Shell will fix 👍

Related ticket from Fish repo: https://github.com/fish-shell/fish-shell/issues/10048

<!-- gh-comment-id:1976617623 --> @NghiaTranUIT commented on GitHub (Mar 4, 2024): Thanks. Selecting `Default Login Shell` will fix 👍 Related ticket from Fish repo: https://github.com/fish-shell/fish-shell/issues/10048
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1271
No description provided.