[GH-ISSUE #657] Automatically install and trust Proxyman Certificate in Android Emulator #654

Open
opened 2026-03-03 19:20:40 +03:00 by kerem · 14 comments
Owner

Originally created by @NghiaTranUIT on GitHub (Oct 13, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/657

Originally assigned to: @NghiaTranUIT on GitHub.

Description

As a title, it's possible to use ADB to:

  • Change the HTTP Proxy
  • Install and trust Proxyman Certificate

all in one click

We should support it as soon as possible since it's painful when manually installing the certificate in Android Emulators.

Acceptance Criteria

  • Add UI for Certificate Installation for Android Emulator
  • Detect if the user hasn't opened any Emulator yet or the Emulator is not Google APIs
  • Write a script to use ADB
  • Write Documentation in case the script doesn't work
Originally created by @NghiaTranUIT on GitHub (Oct 13, 2020). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/657 Originally assigned to: @NghiaTranUIT on GitHub. ### Description As a title, it's possible to use ADB to: - Change the HTTP Proxy - Install and trust Proxyman Certificate all in one click ✅ We should support it as soon as possible since it's painful when manually installing the certificate in Android Emulators. ### Acceptance Criteria - Add UI for Certificate Installation for Android Emulator - Detect if the user hasn't opened any Emulator yet or the Emulator is not Google APIs - Write a script to use ADB - Write Documentation in case the script doesn't work
Author
Owner

@NghiaTranUIT commented on GitHub (Oct 18, 2020):

Beta: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.9.1_Android_Emulator_Script_Automation.dmg

Access via: Certificate Menu -> Install Certificate on Android -> Emulator...

Screen Shot 2020-10-18 at 11 21 30
<!-- gh-comment-id:711116622 --> @NghiaTranUIT commented on GitHub (Oct 18, 2020): Beta: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.9.1_Android_Emulator_Script_Automation.dmg Access via: Certificate Menu -> Install Certificate on Android -> Emulator... <img width="975" alt="Screen Shot 2020-10-18 at 11 21 30" src="https://user-images.githubusercontent.com/5878421/96359077-890b6c00-1138-11eb-9d3c-d79f597e1982.png">
Author
Owner

@jsharp80 commented on GitHub (Jan 7, 2021):

Hello! When I click "Override Emulator," the Terminal launches, but nothing else happens. This is on macOS Big Sur 11.1. I confirmed that adb is installed and launches from the command line. Any ideas?

<!-- gh-comment-id:756133193 --> @jsharp80 commented on GitHub (Jan 7, 2021): Hello! When I click "Override Emulator," the Terminal launches, but nothing else happens. This is on macOS Big Sur 11.1. I confirmed that adb is installed and launches from the command line. Any ideas?
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 7, 2021):

@jsharp80

Can you help me to run the following CLIs on your Terminal?

  1. Check the directory of adb
$ which adb

=> It should be at /usr/local/bin/adb

  1. Open Proxyman and Run the script manually and share with me the output.

Please release 192.168.0.1 with your actual IP (You can find it by navigating to Certificate Menu -> Install on iOS -> Physical Device -> Get the IP)

$ 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:756139193 --> @NghiaTranUIT commented on GitHub (Jan 7, 2021): @jsharp80 Can you help me to run the following CLIs on your Terminal? 1. Check the directory of adb ``` $ which adb ``` => It should be at `/usr/local/bin/adb` 2. Open Proxyman and Run the script manually and share with me the output. Please release `192.168.0.1` with your actual IP (You can find it by navigating to Certificate Menu -> Install on iOS -> Physical Device -> Get the IP) ``` $ 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 (Jan 7, 2021):

It's how the output looks like if it successes

Screen Shot 2021-01-07 at 21 23 41
<!-- gh-comment-id:756148566 --> @NghiaTranUIT commented on GitHub (Jan 7, 2021): It's how the output looks like if it successes <img width="794" alt="Screen Shot 2021-01-07 at 21 23 41" src="https://user-images.githubusercontent.com/5878421/103903672-c62b3d00-512e-11eb-9d7a-8f5790849c35.png">
Author
Owner

@jsharp80 commented on GitHub (Jan 7, 2021):

@NghiaTranUIT - Thanks for the quick reply!

adb is in the correct location - /usr/local/bin/adb

The first time I ran the script, I received the following output:

Checking adb command...
Found at: /usr/local/bin/adb
1. Checking Android Emulators Status...
[ERROR] There are many running Android Emulators!!!
Please close other and keep ONE Android Emulator!

This happened because I also had a physical Android device connected that I use for debugging. After disconnecting it, the script ran as expected and I saw the expected results in Proxyman.

Neither the "override emulator" nor "revert override" scripts execute automatically. The buttons open a zsh Terminal and seem to stop there. That's fine, though, I can execute the scripts manually.

<!-- gh-comment-id:756221080 --> @jsharp80 commented on GitHub (Jan 7, 2021): @NghiaTranUIT - Thanks for the quick reply! adb is in the correct location - `/usr/local/bin/adb` The first time I ran the script, I received the following output: ``` Checking adb command... Found at: /usr/local/bin/adb 1. Checking Android Emulators Status... [ERROR] There are many running Android Emulators!!! Please close other and keep ONE Android Emulator! ``` This happened because I also had a physical Android device connected that I use for debugging. After disconnecting it, the script ran as expected and I saw the expected results in Proxyman. Neither the "override emulator" nor "revert override" scripts execute automatically. The buttons open a zsh Terminal and seem to stop there. That's fine, though, I can execute the scripts manually.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 8, 2021):

@jsharp80 Please help me to open System Preference -> Security -> Privacy Tab -> Click on Automation and verify whether or not you're granting the Proxyman app?

Proxyman uses Apple Script (Automation) to execute the script, so if we don't allow it, it might cause your problem.

Screen_Shot_2021-01-08_at_08_56_06

=> Turn it ON and try again.

Meanwhile, I will add a button to show future users to manually execute the script if it's failed 👍

<!-- gh-comment-id:756498088 --> @NghiaTranUIT commented on GitHub (Jan 8, 2021): @jsharp80 Please help me to open System Preference -> Security -> Privacy Tab -> Click on Automation and verify whether or not you're granting the Proxyman app? Proxyman uses Apple Script (Automation) to execute the script, so if we don't allow it, it might cause your problem. <img width="780" alt="Screen_Shot_2021-01-08_at_08_56_06" src="https://user-images.githubusercontent.com/5878421/103965123-a37d4080-518f-11eb-80df-09b045daa5af.png"> => Turn it ON and try again. Meanwhile, I will add a button to show future users to manually execute the script if it's failed 👍
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 8, 2021):

@jsharp80 good news: I'm able to reproduce your bug. Just turn OFF the Automation permission.

I'm fixing it now: To show the alert if the permission doesn't grant 👍

<!-- gh-comment-id:756503877 --> @NghiaTranUIT commented on GitHub (Jan 8, 2021): @jsharp80 good news: I'm able to reproduce your bug. Just turn OFF the Automation permission. I'm fixing it now: To show the alert if the permission doesn't grant 👍
Author
Owner

@jsharp80 commented on GitHub (Jan 8, 2021):

@NghiaTranUIT - great news! Thanks again for all of your help! Proxyman is a fantastic app. I use it all the time. Thanks for working on it.

<!-- gh-comment-id:756506113 --> @jsharp80 commented on GitHub (Jan 8, 2021): @NghiaTranUIT - great news! Thanks again for all of your help! Proxyman is a fantastic app. I use it all the time. Thanks for working on it.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 8, 2021):

@jsharp80 please check out this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.15.2_Android_Emulator_Automation_Permission.dmg

I will detect whether or not you're granting the permission.

Screen Shot 2021-01-08 at 10 13 44
<!-- gh-comment-id:756520142 --> @NghiaTranUIT commented on GitHub (Jan 8, 2021): @jsharp80 please check out this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.15.2_Android_Emulator_Automation_Permission.dmg I will detect whether or not you're granting the permission. <img width="872" alt="Screen Shot 2021-01-08 at 10 13 44" src="https://user-images.githubusercontent.com/5878421/103970174-33c08300-519a-11eb-9a2b-42884924d64e.png">
Author
Owner

@jsharp80 commented on GitHub (Jan 8, 2021):

@NghiaTranUIT - Looks great. Thanks again for the help and the app update!

<!-- gh-comment-id:756834993 --> @jsharp80 commented on GitHub (Jan 8, 2021): @NghiaTranUIT - Looks great. Thanks again for the help and the app update!
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 9, 2021):

@jsharp80 You're welcome 🎉

<!-- gh-comment-id:757077023 --> @NghiaTranUIT commented on GitHub (Jan 9, 2021): @jsharp80 You're welcome 🎉
Author
Owner

@qeude commented on GitHub (Mar 15, 2021):

@NghiaTranUIT Hi, just a small feedback, I was first using it on an emulator with Google Play Store, and the bash output wasn't clear since it was passing every step to a final success, which was wrong. On step 5 in the bash script, we should check if the command L103 works and exit if it doesn't IMO, would be more clear that it doesn't succeed.
Screenshot 2021-03-15 at 10 48 25

<!-- gh-comment-id:799281643 --> @qeude commented on GitHub (Mar 15, 2021): @NghiaTranUIT Hi, just a small feedback, I was first using it on an emulator with Google Play Store, and the bash output wasn't clear since it was passing every step to a final success, which was wrong. On step 5 in the bash script, we should check if the command L103 works and exit if it doesn't IMO, would be more clear that it doesn't succeed. <img width="1001" alt="Screenshot 2021-03-15 at 10 48 25" src="https://user-images.githubusercontent.com/19294297/111134495-fa323c80-857b-11eb-8d1c-1970400a0236.png">
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 15, 2021):

Thank @qeude for the input. It's a good point. I will improve to make clearer in next release 👍

<!-- gh-comment-id:799287507 --> @NghiaTranUIT commented on GitHub (Mar 15, 2021): Thank @qeude for the input. It's a good point. I will improve to make clearer in next release 👍
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 21, 2021):

Hey @qeude I fixed this issue in this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.20.0_Better_ADB_Script_And_Factory_Reset.dmg

I will include it in the next release 🎉

<!-- gh-comment-id:803522301 --> @NghiaTranUIT commented on GitHub (Mar 21, 2021): Hey @qeude I fixed this issue in this beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.20.0_Better_ADB_Script_And_Factory_Reset.dmg I will include it in the next release 🎉
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#654
No description provided.